0

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="info@domain.com" deliveryMethod="Network"  >
        <network host="mail.domain.com" password="xxx" port="465" userName="info@domain.com" enableSsl="true"  />
      </smtp>
    </mailSettings>
Lucifer
  • 28,605
  • 21
  • 86
  • 137
Harvinder
  • 81
  • 10
  • Did you try port 587 instead? Normally thats the one you'd use for sending mail via SSL. Also pls post your email creation/dispatch code. – steve cook May 05 '14 at 04:03
  • I am using following code:- MailMessage message = new MailMessage(); message.To.Add("abc@domain.com"); message.Body = "Test"; message.Subject = "test"; new SmtpClient().Send(message); – Harvinder May 05 '14 at 04:24
  • With Port 587:- Error:- Unable to connect to the remote server – Harvinder May 05 '14 at 04:26

1 Answers1

0

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?

Harvinder
  • 81
  • 10