Regarding Sending Mail

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krisssgopi
    New Member
    • Apr 2010
    • 39

    Regarding Sending Mail

    Hi Team,

    I am trying to send email using Asp.net with code behind Vb.net. I cant able to send email and it was not throwing any exceptions. Please help me where it was getting hick up.

    Code:
    Try
                message.From = New MailAddress("krisssgopi@gmail.com")
                message.To.Add(New MailAddress("jeganrengasamy@gmail.com"))
                message.IsBodyHtml = False
                message.Priority = MailPriority.Normal
                message.Subject = "Hi Buddy.."
                message.Body = "This is testing mail.."
                MsgBox("message sent..")
                smtp.Host = "smtp.gmail.com"
                smtp.Port = 25
                smtp.UseDefaultCredentials = False
                smtp.Credentials = New System.Net.NetworkCredential("krisssgopi", "xxxxxx")
                smtp.DeliveryMethod = SmtpDeliveryMethod.Network
                smtp.Send(message)
                MsgBox("message sent..")
            Catch ex As Exception
                ex.Message.ToString()
            End Try
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Gmail doesn't use port 25 because it uses secure connections. According to this Google article on configuring other mail clients - Gmail help, you should be using port 465 for outgoing mail.

    -Frinny

    Comment

    • krisssgopi
      New Member
      • Apr 2010
      • 39

      #3
      Thank You, i have done it. thanks for your response.

      Comment

      Working...