0

Hi, I need help with sending an email through gmail from a program. I substituted email adresses and passwords with generic names, this program works up to the last line where it fails to send the email. Any ideas as to why this may be?

This is using

imports system.net.mail

btw

Dim mail As New MailMessage()
        mail.From = New MailAddress("email1@gmail.com")
        mail.To.Add("email2@gmail.com")
        mail.Subject = "This is an email"
        mail.Body = "this is the body content of the email."
        Dim smtp As New SmtpClient("smtp.gmail.com")
        smtp.Credentials = New Net.NetworkCredential("email1@gmail.com", "password")
        smtp.Send(mail)
2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by conan82ac
0

never mind I figured it out, in case anyone was wondering I had to change the port number and enable SSL

0

never mind I figured it out, in case anyone was wondering I had to change the port number and enable SSL

can you explained to me, how to figured it out???
cause i have this problem too.
Thank's

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.