|
-
Feb 28th, 2011, 01:31 PM
#1
Thread Starter
Junior Member
Send mail to a email that has been entered in a text box
Ok Guys i need help how can i get this to work :
Code:
Dim text As String
text = TextBox1.Text & TextBox2.Text + vbLf
Dim myClient As New Net.Mail.SmtpClient("smtp.web.de")
myClient.Credentials = New NetworkCredential(Form2.TextBox2.Text, Form2.TextBox3.Text)
myClient.Send(Form2.TextBox2.Text, Form2.TextBox2.Text, , "test", text)
so i want to send it to a mail adress that hasnt been declared and that you have to enter first .... it says me that VB cant handle it.... can u help me please ?
-
Feb 28th, 2011, 01:36 PM
#2
Re: Send mail to a email that has been entered in a text box
In all the years, and all the versions, of my VB experience I have never seen an error message that said "VB Can't handle it."
Could you give us the exact wording of the error message please?
Also, is it happening on the "myClient.Send" line or somewhere else?
-
Feb 28th, 2011, 01:45 PM
#3
Thread Starter
Junior Member
Re: Send mail to a email that has been entered in a text box
 Originally Posted by Hack
In all the years, and all the versions, of my VB experience I have never seen an error message that said "VB Can't handle it."
Could you give us the exact wording of the error message please?
Also, is it happening on the "myClient.Send" line or somewhere else?
I think its a bit difficult cause my version isnt english ....
i tried with google translator and its in the last line !
so heres the translation
Error when overload resolution, because no accessible "Send" accepts this number of arguments
or somethign like that
-
Feb 28th, 2011, 02:45 PM
#4
Re: Send mail to a email that has been entered in a text box
Remove the empty argument from your parameter list. That is:
Code:
'change this:
myClient.Send(Form2.TextBox2.Text, Form2.TextBox2.Text, , "test", text)
'to this
myClient.Send(Form2.TextBox2.Text, Form2.TextBox2.Text, "test", text)
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Mar 1st, 2011, 01:42 PM
#5
Thread Starter
Junior Member
Re: Send mail to a email that has been entered in a text box
 Originally Posted by stanav
Remove the empty argument from your parameter list. That is:
Code:
'change this:
myClient.Send(Form2.TextBox2.Text, Form2.TextBox2.Text, , "test", text)
'to this
myClient.Send(Form2.TextBox2.Text, Form2.TextBox2.Text, "test", text)
no dude in that there is something missing
what can i do to fix that freakin Error !
-
Mar 1st, 2011, 02:30 PM
#6
Re: Send mail to a email that has been entered in a text box
If you look at the documentation, you'll see there's two overloads. One takes a MailMessage parameter, the other takes four strings. If you provide any other combination of parameters, VB .NET doesn't have a method to call and will complain.
You're trying to use the one that takes four strings. You're providing five strings and an empty argument. That's not going to work. stanav is trying to tell you this. There can't be something missing in your blank space because there is no Send() that takes five parameters. stanav's suggestion is correct.
-
Mar 1st, 2011, 02:48 PM
#7
Thread Starter
Junior Member
Re: Send mail to a email that has been entered in a text box
 Originally Posted by Sitten Spynne
If you look at the documentation, you'll see there's two overloads. One takes a MailMessage parameter, the other takes four strings. If you provide any other combination of parameters, VB .NET doesn't have a method to call and will complain.
You're trying to use the one that takes four strings. You're providing five strings and an empty argument. That's not going to work. stanav is trying to tell you this. There can't be something missing in your blank space because there is no Send() that takes five parameters. stanav's suggestion is correct.
But stanavs suggestion doesnt work , cause VB tells me if i use his code that something is missing
-
Mar 1st, 2011, 02:58 PM
#8
Re: Send mail to a email that has been entered in a text box
I understand that it's difficult to translate the error, but if we don't know the exact error message it's hard to help. Nothing can be missing because you have provided four parameters. Let's try going back to your description and figuring out what's going on:
Error when overload resolution, because no accessible "Send" accepts this number of arguments
OK, that's strange. That would indicate that no available overloads take four arguments. But we just looked at documentation that says you need one or four. Either you did not type the code properly or you aren't telling us the right error message. Make sure you didn't include all of stanav's code; you were supposed to change your line that matches his first line to the second line. In other words, delete your "myClient.Send(..." line and replace it with this:
Code:
myClient.Send(Form2.TextBox2.Text, Form2.TextBox2.Text, "test", text)
If that doesn't work, something strange is going on and it might take more of your code to decide what is causing the problem.
-
Mar 2nd, 2011, 10:04 AM
#9
Thread Starter
Junior Member
Re: Send mail to a email that has been entered in a text box
 Originally Posted by Sitten Spynne
I understand that it's difficult to translate the error, but if we don't know the exact error message it's hard to help. Nothing can be missing because you have provided four parameters. Let's try going back to your description and figuring out what's going on:
OK, that's strange. That would indicate that no available overloads take four arguments. But we just looked at documentation that says you need one or four. Either you did not type the code properly or you aren't telling us the right error message. Make sure you didn't include all of stanav's code; you were supposed to change your line that matches his first line to the second line. In other words, delete your "myClient.Send(..." line and replace it with this:
Code:
myClient.Send(Form2.TextBox2.Text, Form2.TextBox2.Text, "test", text)
If that doesn't work, something strange is going on and it might take more of your code to decide what is causing the problem.
OK so i will try what i can and if it still doesnt work i might make a video
-
Mar 2nd, 2011, 10:11 AM
#10
Thread Starter
Junior Member
Re: Send mail to a email that has been entered in a text box
 Originally Posted by Sitten Spynne
I understand that it's difficult to translate the error, but if we don't know the exact error message it's hard to help. Nothing can be missing because you have provided four parameters. Let's try going back to your description and figuring out what's going on:
OK, that's strange. That would indicate that no available overloads take four arguments. But we just looked at documentation that says you need one or four. Either you did not type the code properly or you aren't telling us the right error message. Make sure you didn't include all of stanav's code; you were supposed to change your line that matches his first line to the second line. In other words, delete your "myClient.Send(..." line and replace it with this:
Code:
myClient.Send(Form2.TextBox2.Text, Form2.TextBox2.Text, "test", text)
If that doesn't work, something strange is going on and it might take more of your code to decide what is causing the problem.
DUDe nevermind i did something wrong ! it was my fault sry
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|