Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Pls help i am getting below error message at the time of sending email from vb.net application.

"{"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 74.125.130.109:587"}"



Below is my code
VB
Dim SimpleSMTP As New SmtpClient("smtp.gmail.com")
            With SimpleSMTP
                .Port = 587
                .EnableSsl = True
                .Credentials = New NetworkCredential(gmailusername, gmailpassword) 
                .Send(AnEmailMessage)
            End With
Posted
Updated 23-Aug-13 21:45pm
v2

1 solution

use the code :

VB
Dim s As New SmtpClient
       s.Host = "smtp.gmail.com"
       s.Port = 587
       s.EnableSsl = True
       's.Timeout = 200
       s.Credentials = New NetworkCredential("youremail@gmail.com", "yourpassord")

       Dim m As New MailMessage
       m.To.Add("useremail@hotmail.com")
       m.From = New MailAddress("youremail@gmail.com")
       m.Subject = "subiect text"
       m.Body = "email body text"
       s.Send(m)
       Label6.Text = "sent email"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900