Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15711

Can't send email

$
0
0
Hello,

Please help me with the following problem. It is a code that worked in the past and now it doesn't work and I don't know why. It sends an email:

Code:

Try
            Dim SmtpServer As New SmtpClient()
            Dim mail As New MailMessage()
            SmtpServer.Credentials = New Net.NetworkCredential("email@gmail.com", "password")

            SmtpServer.EnableSsl = True
            SmtpServer.Port = 587
            SmtpServer.Host = "smtp.gmail.com"
            mail = New MailMessage()
            mail.To.Add("myemail@gmail.com")
            mail.From = New MailAddress("email@gmail.com")

            mail.Subject = "Subject text"
            mail.Body = "Body text"
            SmtpServer.Send(mail)
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

And I get this message in the attached picture.Name:  Untitled.png
Views: 44
Size:  15.4 KB
Attached Images
 

Viewing all articles
Browse latest Browse all 15711

Trending Articles