Menu

C# send email using implicit ssl

How to send System.Net.Mail over SSL on 465 port

It is impossible for you to send email on 465 port using System.Net.mail and this is the mail goal that we have Aegis Implicit Mail (AIM)

Why do I have problem with port 465 while other ports are working?

Port 465 is a standard port that is used for Implicit Ssl SMTP communications.
We have two types of SSL\TLS, implicit(SSL) and Explicit(TLS)
As you might know, SMTP is in a way a normal socket communication which transfers specific packets.
The difference between implicit and explicit ssl mail servers relays on handshaking.
In implicit smtp communication the whole process in using SSL, including handshaking (usually port 465).
If you secure a normal mail server with Ssl certificate, that will be come implicit, because you are having a security layer over all of transactions

How to Identify if my server is not an Explicit Mail Server?

The easiest way is port number.
SMTP/SSL is often offered on port 465, but this is not registered, and is less common since support for explicit SSL is widely supported by SMTP agents. Some companies might use their own numbering.

There are IANA registered port numbers for secure mail, but some ISPs may use other ports.
IMAP/SSL: 993
POP3/SSL: 995

The other way is to check if server has support for STARTTLS command.
When a client connects to an SMTP server, and issues the EHLO command, the server will list its capabilities, if you can find STARTTLS command it means that your server is supporting explicit connection

Is there any alternative to send email to implicit ssl servers using .net?

Of Course but you may use the deprecated System.Web.Mail.MailMessage API (and set its "http://schemas.microsoft.com/cdo/configuration/smtpusessl" option, for explicit SSL/TLS):

System.Web.Mail.MailMessage mailMsg = new System.Web.Mail.MailMessage();
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl",true);

Another way is to establish a SSL/TLS tunnel to your server and the send normail email without usage of SSL. By using this way, you do the handshaking and transferring to SMTP server using ssl tunnel.

How to send Email over SSL on 465 port?

If you ask me, I would certainly advise you to use Aegis Implicit Mail (AIM)

Why to use Aegis Implicit Mail?

  1. Firstly AIM (Aegis Implicit Mail) is free and open source library.
  2. It is easy to use
  3. Usage of AIM is exactly like System.Net.Mail, you can easily add implicit mail server support to your existing .net code.
  4. AIM also have extra features, like S\MIME support. You can use the same structure for signed and encrypted mails.
  5. Full support of PKI

Is there any library to send mail to implicit ssl servers?

Yes, There are several third party libraries which can be used in-order to send mime/smime mails to implicit ssl smtp mail servers.
For example Secure Black Box mail component, Chilkat .net library or MailBee.Net


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.