Hello All,
I'm trying to send a simple email via vb.net. This is the first time i've tried this and am getting the same message every time. I've looked everywhere with no answer... The host that i use is bluehost, and i know the port name and the client name and username and password are correct. So i'm not sure what i'm doing wrong, perhaps it's thinking i should be sending from my localhost, or my ip address? Either way, below is the error i'm getting, and the code. The # just represent the numbers in the error and so on and so forth. Thanks for the help.
Mailbox unavailable. The server response was: cpe - ##-###-###-###... (my-pc)[my ip address] is currently at...
I'm trying to send a simple email via vb.net. This is the first time i've tried this and am getting the same message every time. I've looked everywhere with no answer... The host that i use is bluehost, and i know the port name and the client name and username and password are correct. So i'm not sure what i'm doing wrong, perhaps it's thinking i should be sending from my localhost, or my ip address? Either way, below is the error i'm getting, and the code. The # just represent the numbers in the error and so on and so forth. Thanks for the help.
Mailbox unavailable. The server response was: cpe - ##-###-###-###... (my-pc)[my ip address] is currently at...
VB.NET:
Try
Dim Mail As New MailMessage
Mail.Subject = "The Email Subject"
Mail.To.Add("[EMAIL="myemailaddress@gmail.com"]myemailaddress@gmail.com[/EMAIL]")
Mail.From = New MailAddress("[EMAIL="MyName@MyWebsite.com"]MyName@MyWebsite.com[/EMAIL]")
Mail.Body = " The Email Body"
Dim SMTP As New SmtpClient("box***.bluehost.com")
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential("myusername", "mypassword")
SMTP.Port = "26"
SMTP.Send(Mail)
MsgBox("mail sent!")
Catch ex As Exception
MsgBox(ex.ToString)
End Try