Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem in sending email [modified]

Problem in sending email [modified]

Scheduled Pinned Locked Moved ASP.NET
helpquestioncomsysadmin
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Khaled Hossain
    wrote on last edited by
    #1

    I am writing a code which send Email to the respective email address. First time its working fine. But after sending my first email its not accept my program and I am not able to send email again. I put the code snippet here.

    Dim smtpServer As New SmtpClient
    Dim messageSTR As New MailMessage
    Dim strAddress As New MailAddress("Email address", "Name")

    messageSTR.From = strAddress
    messageSTR.To.Add("To Email Address")
    messageSTR.Subject = Me.txtSub.Text
    messageSTR.Body = Me.txtMailBody.Text

    smtpServer.Host = "smtp.gmail.com"
    smtpServer.Port = 578

    smtpServer.Credentials = New NetworkCredential("user id", "user pass")

    smtpServer.EnableSsl = true
    smtpServer.Send(messageSTR)

    What is the problem? Why I don't send the second mail? Exception Shown: 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 209.85.129.109:578. Error Message: Unable to connect to the remote server

    modified on Friday, January 1, 2010 11:23 AM

    B K 2 Replies Last reply
    0
    • K Khaled Hossain

      I am writing a code which send Email to the respective email address. First time its working fine. But after sending my first email its not accept my program and I am not able to send email again. I put the code snippet here.

      Dim smtpServer As New SmtpClient
      Dim messageSTR As New MailMessage
      Dim strAddress As New MailAddress("Email address", "Name")

      messageSTR.From = strAddress
      messageSTR.To.Add("To Email Address")
      messageSTR.Subject = Me.txtSub.Text
      messageSTR.Body = Me.txtMailBody.Text

      smtpServer.Host = "smtp.gmail.com"
      smtpServer.Port = 578

      smtpServer.Credentials = New NetworkCredential("user id", "user pass")

      smtpServer.EnableSsl = true
      smtpServer.Send(messageSTR)

      What is the problem? Why I don't send the second mail? Exception Shown: 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 209.85.129.109:578. Error Message: Unable to connect to the remote server

      modified on Friday, January 1, 2010 11:23 AM

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      Can you post the error details that you are getting.It'll be of helpful to give the relevent answer

      Cheers!! Brij

      1 Reply Last reply
      0
      • K Khaled Hossain

        I am writing a code which send Email to the respective email address. First time its working fine. But after sending my first email its not accept my program and I am not able to send email again. I put the code snippet here.

        Dim smtpServer As New SmtpClient
        Dim messageSTR As New MailMessage
        Dim strAddress As New MailAddress("Email address", "Name")

        messageSTR.From = strAddress
        messageSTR.To.Add("To Email Address")
        messageSTR.Subject = Me.txtSub.Text
        messageSTR.Body = Me.txtMailBody.Text

        smtpServer.Host = "smtp.gmail.com"
        smtpServer.Port = 578

        smtpServer.Credentials = New NetworkCredential("user id", "user pass")

        smtpServer.EnableSsl = true
        smtpServer.Send(messageSTR)

        What is the problem? Why I don't send the second mail? Exception Shown: 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 209.85.129.109:578. Error Message: Unable to connect to the remote server

        modified on Friday, January 1, 2010 11:23 AM

        K Offline
        K Offline
        Khaled Hossain
        wrote on last edited by
        #3

        The problem was, I am writing the invalid port number. I put portnumber=578 But it should be 587. Thanks.

        A B 2 Replies Last reply
        0
        • K Khaled Hossain

          The problem was, I am writing the invalid port number. I put portnumber=578 But it should be 587. Thanks.

          A Offline
          A Offline
          AhsanS
          wrote on last edited by
          #4

          is your problem resolved? If so kindly write it so that others may know that your problem is resolved :laugh:

          Ahsan Ullah Senior Software Engineer MCTS 2.0

          1 Reply Last reply
          0
          • K Khaled Hossain

            The problem was, I am writing the invalid port number. I put portnumber=578 But it should be 587. Thanks.

            B Offline
            B Offline
            Brij
            wrote on last edited by
            #5

            ok.. but wasn't it created the problem in sending first mail ? :)

            Cheers!! Brij

            K 1 Reply Last reply
            0
            • B Brij

              ok.. but wasn't it created the problem in sending first mail ? :)

              Cheers!! Brij

              K Offline
              K Offline
              Khaled Hossain
              wrote on last edited by
              #6

              At first, I send mail using default port number. Then I take it from the user and then creates the problem. Thanks

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups