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 ?
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?
Re: Send mail to a email that has been entered in a text box
Quote:
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
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)
Re: Send mail to a email that has been entered in a text box
Quote:
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 !
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.
Re: Send mail to a email that has been entered in a text box
Quote:
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
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:
Quote:
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.
Re: Send mail to a email that has been entered in a text box
Quote:
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
Re: Send mail to a email that has been entered in a text box
Quote:
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