rani says:
smtp.Port = 25
smtp.EnableSsl =
False
Your Firewall is blocking port 25.
Set the Port number to 587 or 465 and EnableSsl to True.
Private Function SendEmail() As Boolean
Dim mm As New MailMessage("test@gmail.com", "test1@gmail.com")
mm.Subject = "Test"
mm.Body = "test"
mm.IsBodyHtml = True
Dim smtp As New SmtpClient()
smtp.Host = "smtp.gmail.com"
smtp.Port = 587
smtp.EnableSsl = True
Dim NetworkCred As New NetworkCredential()
NetworkCred.UserName = "test@gmail.com"
NetworkCred.Password = "test"
smtp.UseDefaultCredentials = True
smtp.Credentials = NetworkCred
Try
smtp.Send(mm)
Catch e As Exception
Response.Write(e.Message)
End Try
Return True
End Function