Search code examples
c#asp.net

SMTP Email error with port 465


I am trying to send email from C#.net and getting following error:-

Unable to read data from the transport connection: net_io_connectionclosed.

Same code is working fine with port: 25, but throwing error when update to port: 465

I have tested the SMTP settings with port 465 in Outlook and it works fine. Only have issue while sending through C#.

I am using following email settings.

  <mailSettings>
      <smtp from="[email protected]" deliveryMethod="Network"  >
        <network host="mail.domain.com" password="xxx" port="465" userName="[email protected]" enableSsl="true"  />
      </smtp>
    </mailSettings>

Solution

  • System.Net.Mail.SmtpClient does not support Implicit SSL. Using old component System.Web.Mail is working fine.

    How can I send emails through SSL SMTP with the .NET Framework?