none
Unable to read data from the transport connection: net_io_connectionclosed.

    Question

  • Hi,

    I am trying to send email using rediffmail smtp server(smtp.rediffmail.com, 587)... it gives error.. but same code are working fine with other smtp servers. Please help me out to find the soluation.

    My code is:

    MailMessage msg = new MailMessage();
    msg.From = new MailAddress(From);
    msg.IsBodyHtml = true;
    msg.Subject = Subject;
    msg.Body = Body;
    msg.To.Add(To);
    msg.Priority = MailPriority.High;

    SmtpClient emailClient = new SmtpClient("smtp.rediffmail.com", 587);
    System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential(xxxxxxx@rediffmail.com, xxxxxxxxx);
    emailClient.UseDefaultCredentials = false;
    emailClient.Credentials = SMTPUserInfo;
    emailClient.EnableSsl = false;

    emailClient.Send(msg);

    Exception Detail

    System.Net.Mail.SmtpException was unhandled by user code
    Message="Failure sending mail."
    Source="System"
      StackTrace:
           at System.Net.Mail.SmtpClient.Send(MailMessage message)
           at EmailSender.SendEmail(String SMTP, String To, String Subject, String Body) in C:\Users\devproj11\Documents\Visual Studio 2008\Projects\WebApplication1\WebApplication1\EmailSender.cs:line 90
           at WebApplication1.Email.btnSend_Click(Object sender, EventArgs e) in C:\Users\devproj11\Documents\Visual Studio 2008\Projects\WebApplication1\WebApplication1\Email.aspx.cs:line 67
           at System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e)
           at System.Web.UI.HtmlControls.HtmlInputButton.RaisePostBackEvent(String eventArgument)
           at System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
           at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
           at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
           at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
      InnerException: System.IO.IOException
           Message="Unable to read data from the transport connection: net_io_connectionclosed."
           Source="System"
           StackTrace:
                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.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)
           InnerException:

    Thursday, May 02, 2013 11:26 AM

All replies

  • Hi,

    Have you verified that the smtp server and port number are correct?

    Thursday, May 02, 2013 11:46 AM
  • Hi,

    I think yes... what i find on internet

    SMTP server:    smtp.rediffmail.com
    Port:                  25 or 587


    Regards, Amit L

    Thursday, May 02, 2013 11:55 AM
  • Does it give the same exception message when you try port 25?
    Thursday, May 02, 2013 12:26 PM
  • If i am using port 25 then exception message is different. But what i find that port 25 is not working for other SMTP Servers.

    --

    Service not available, closing transmission channel. The server response was: Authorization failed: please authenticate by doing get message first

    Exception Detail

    System.Net.Mail.SmtpException was unhandled by user code
      Message="Service not available, closing transmission channel. The server response was: Authorization failed: please authenticate by doing get message first"
      Source="System"
      StackTrace:
           at System.Net.Mail.RecipientCommand.CheckResponse(SmtpStatusCode statusCode, String response)
           at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
           at System.Net.Mail.SmtpClient.Send(MailMessage message)
           at EmailSender.SendEmail(String SMTP, String To, String Subject, String Body) in C:\Users\devproj11\Documents\Visual Studio 2008\Projects\WebApplication1\WebApplication1\EmailSender.cs:line 90
           at WebApplication1.Email.btnSend_Click(Object sender, EventArgs e) in C:\Users\devproj11\Documents\Visual Studio 2008\Projects\WebApplication1\WebApplication1\Email.aspx.cs:line 67
           at System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e)
           at System.Web.UI.HtmlControls.HtmlInputButton.RaisePostBackEvent(String eventArgument)
           at System.Web.UI.HtmlControls.HtmlInputButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
           at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
           at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
           at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
      InnerException:


    Regards, Amit L

    Friday, May 03, 2013 5:14 AM
  • Hi Amit,

    You can consider post it in below more appropriate forum. Thanks.

    http://social.msdn.microsoft.com/Forums/en-US/wcf/threads


    Bob Shen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 07, 2013 6:13 AM