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. Mail sending failed

Mail sending failed

Scheduled Pinned Locked Moved ASP.NET
csharpcomquestion
5 Posts 5 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
    kavinnagarajan
    wrote on last edited by
    #1

    When i try to send i caught as exception like below, System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.SmtpReplyReader.ReadLine() at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) and mycode is protected void Button1_Click(object sender, EventArgs e) { try { MailMessage mail = new MailMessage(); mail.From = new MailAddress("shankarganesh.mca@gmail.com"); mail.To.Add(new MailAddress("shankarganesh.mca@gmail.com")); mail.Subject = "Subject"; mail.Body = "This is Body"; mail.IsBodyHtml = true; mail.Priority = MailPriority.Normal; SmtpClient client = new SmtpClient(); client.Send(mail); } catch (SmtpException ex) { Response.Write(ex.InnerException); } } can anyone find solution for this?

    C C V S 4 Replies Last reply
    0
    • K kavinnagarajan

      When i try to send i caught as exception like below, System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.SmtpReplyReader.ReadLine() at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) and mycode is protected void Button1_Click(object sender, EventArgs e) { try { MailMessage mail = new MailMessage(); mail.From = new MailAddress("shankarganesh.mca@gmail.com"); mail.To.Add(new MailAddress("shankarganesh.mca@gmail.com")); mail.Subject = "Subject"; mail.Body = "This is Body"; mail.IsBodyHtml = true; mail.Priority = MailPriority.Normal; SmtpClient client = new SmtpClient(); client.Send(mail); } catch (SmtpException ex) { Response.Write(ex.InnerException); } } can anyone find solution for this?

      C Offline
      C Offline
      Coding C
      wrote on last edited by
      #2

      try this code

      MailMessage message = new MailMessage(strEmailFrom, ToEmail, Subject, Body);

                  message.IsBodyHtml = IsBodyHtml;
                  SmtpClient emailClient = new SmtpClient(SMTPServer);
                  System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential(SMTPUser, SMTPPassword);
                  emailClient.UseDefaultCredentials = false;
                  emailClient.Credentials = SMTPUserInfo;
                  emailClient.Send(message);
      

      Coding C# ExciteTemplate

      1 Reply Last reply
      0
      • K kavinnagarajan

        When i try to send i caught as exception like below, System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.SmtpReplyReader.ReadLine() at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) and mycode is protected void Button1_Click(object sender, EventArgs e) { try { MailMessage mail = new MailMessage(); mail.From = new MailAddress("shankarganesh.mca@gmail.com"); mail.To.Add(new MailAddress("shankarganesh.mca@gmail.com")); mail.Subject = "Subject"; mail.Body = "This is Body"; mail.IsBodyHtml = true; mail.Priority = MailPriority.Normal; SmtpClient client = new SmtpClient(); client.Send(mail); } catch (SmtpException ex) { Response.Write(ex.InnerException); } } can anyone find solution for this?

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Where has this been code been connected to an actual, live, mail server ?

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        1 Reply Last reply
        0
        • K kavinnagarajan

          When i try to send i caught as exception like below, System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.SmtpReplyReader.ReadLine() at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) and mycode is protected void Button1_Click(object sender, EventArgs e) { try { MailMessage mail = new MailMessage(); mail.From = new MailAddress("shankarganesh.mca@gmail.com"); mail.To.Add(new MailAddress("shankarganesh.mca@gmail.com")); mail.Subject = "Subject"; mail.Body = "This is Body"; mail.IsBodyHtml = true; mail.Priority = MailPriority.Normal; SmtpClient client = new SmtpClient(); client.Send(mail); } catch (SmtpException ex) { Response.Write(ex.InnerException); } } can anyone find solution for this?

          V Offline
          V Offline
          Vimalsoft Pty Ltd
          wrote on last edited by
          #4

          You did not setup the Port

          Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

          1 Reply Last reply
          0
          • K kavinnagarajan

            When i try to send i caught as exception like below, System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed. at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.SmtpReplyReader.ReadLine() at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) and mycode is protected void Button1_Click(object sender, EventArgs e) { try { MailMessage mail = new MailMessage(); mail.From = new MailAddress("shankarganesh.mca@gmail.com"); mail.To.Add(new MailAddress("shankarganesh.mca@gmail.com")); mail.Subject = "Subject"; mail.Body = "This is Body"; mail.IsBodyHtml = true; mail.Priority = MailPriority.Normal; SmtpClient client = new SmtpClient(); client.Send(mail); } catch (SmtpException ex) { Response.Write(ex.InnerException); } } can anyone find solution for this?

            S Offline
            S Offline
            Sundeep Ganiga
            wrote on last edited by
            #5

            Go Through this link Once,It might Help You.. I Have not Tried This... Send Email

            Sundeep Ganiga When the only tool you have is a hammer, everything looks like a nail. Come Forth Yourself to Click "Good Answer" for any expected solution. Let us Support our C Project Programmers who provide solutions here.

            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