C # send email using implicit ssl

Is there any library that can be free that can be used to check email using the implicit ssl protocol. My hosting provider supports ssl emails ... but the standard .net email client cannot handle this.

+4
source share
7 answers

System.Net.Mail supports "explicit SSL" (also known as "StartTLS" - usually on port 25 or 587), but not "implicit SSL" (aka "SMTPS" - usually on port 465).

As far as I know, explicit SSL is started from an insecure connection, then the STARTTLS command is issued, and finally, a secure SSL connection is created. Implicit SSL, on the other hand, requires an SSL connection to be configured before both parties begin to speak.

Some servers (e.g. gmail) accept both, so you just need to set EnableSsl to true and send to the right port. If your server does not support explict SSL, this "easy way" is not an option.

I am also still considering a general solution for using System.Net.Mail with implicit SSL, without knowledge.

Anyway, look in this article , this may give you some idea.

[edit: @ Nikita is right, fixed port numbers to avoid confusion]

+3
source

Use the TLS port (i.e. 587), not the SSL port. I had the same problem for several months until I found this solution.

Sending Email in .NET via Gmail

+1
source

Try checking AIM (Aegis Implicit Mail) at https://sourceforge.net/p/netimplicitssl/wiki/Home/

+1
source

You can still 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); 

Alternatively, if you can, you can run something like stunnel locally to establish an SSL / TLS tunnel from localhost to your SMTP server. Then you will need to connect normally (without SSL / TLS) to the localhost tunnel as your SMTP server.

0
source

As one option, our SecureBlackbox includes SMTP , which works with both implicit and explicit SSL and supports various authentication mechanisms (including SASL, NTLM, etc.).

0
source

AspNetEmail supports explicit SSL and implicit ssl

http://www.advancedintellect.com/download.aspx

0
source

You can use AIM (Aegis Implicit Mail) to send email over implicit SSL:

  • Install the package first: Install-Package AIM
  • Then use the sample code to send email

     class Mail { private static string mailAddress = "{you email address}"; private static string host = "{your host server}"; private static string userName = "{your user name}"; private static string password = "{your password}"; private static string userTo = "{to address}"; private static void SendEmail(string subject, string message) { //Generate Message var mailMessage = new MimeMailMessage(); mailMessage.From = new MimeMailAddress(mailAddress); mailMessage.To.Add(userTo); mailMessage.Subject = subject; mailMessage.Body = message; //Create Smtp Client var mailer = new MimeMailer(host, 465); mailer.User = userName; mailer.Password = password; mailer.SslType = SslMode.Ssl; mailer.AuthenticationMode = AuthenticationType.Base64; //Set a delegate function for call back mailer.SendCompleted += compEvent; mailer.SendMailAsync(mailMessage); } //Call back function private static void compEvent(object sender, AsyncCompletedEventArgs e) { if (e.UserState != null) Console.Out.WriteLine(e.UserState.ToString()); Console.Out.WriteLine("is it canceled? " + e.Cancelled); if (e.Error != null) Console.Out.WriteLine("Error : " + e.Error.Message); } } 
0
source

Source: https://habr.com/ru/post/1391238/


All Articles