Author: ryguy7272 | Posted on: 9/23/2009 2:16:08 PM | Views : 406

I'm trying the VB method described here:
http://www.systemnetmail.com/faq/2.1.aspx


Here is my VB code:
Dim mail As New MailMessage()
mail.From = New MailAddress("ryans@gmail.com", "Ryan")
mail.To.Add("ryans@hotmail.com.com")
mail.Subject = "This is an email"
mail.Body = "this is the body content of the email."
Dim smtp As SmtpClient = New SmtpClient()
smtp.Host = "smtp.gmail.com"
smtp.Send(mail)


A few seconds after I hit the command button I get this message, 'smtpexception was unhandled by user code'
smtp.Send(mail) < --  this line is hilighted green.

I also tried it with a few extra lines of code:
smtp.Host = "smtp.gmail.com"
smtp.Port = 25
smtp.Credentials = New System.Net.NetworkCredential("ryans", "passwordhere")
smtp.EnableSsl = True
...

Go to the complete details ...