Send e-mail using SSL

前端 未结 3 1793
一生所求
一生所求 2021-01-27 02:36

I want my application to send e-mail using \'SMTP over SSL\' even if TLS is not supported by server. So far I have tried

        try
        {
            MailM         


        
相关标签:
3条回答
  • 2021-01-27 03:07

    Please change your code..

     SmtpServer.EnableSsl = false; 
    
    0 讨论(0)
  • 2021-01-27 03:20

    This link shows one more way that I can send email using SMTP over SSL with the help of Collaboration Data Objects component. This way also supports embedding images to email.

    0 讨论(0)
  • 2021-01-27 03:29

    According to the SMTPClient spec: https://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.enablessl(v=vs.110).aspx

    The SmtpClient class only supports the SMTP Service Extension for Secure SMTP over Transport Layer Security as defined in RFC 3207. In this mode, the SMTP session begins on an unencrypted channel, then a STARTTLS command is issued by the client to the server to switch to secure communication using SSL. See RFC 3207 published by the Internet Engineering Task Force (IETF) for more information.

    You can try using System.Web.Mail.SmtpMail, which is deprecated, but which supports SSL:

    https://msdn.microsoft.com/en-us/library/system.web.mail.smtpmail(v=vs.110).aspx

    TBH I think you should place a caveat on your service and state that only SMTP servers that use TLS are supported. But at the end of the day, that is up to you.

    0 讨论(0)
提交回复
热议问题