Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29758

System.Net.Mail.SmtpException: Server does not support secure connections

$
0
0

I am getting the above error when sending an email. I get and exception saying : System.Net.Mail.SmtpException: Server does not support secure connections. Below is my code which I am using to set smtp details.

    public ActionResult ForgotPassword()
    {
        using (MailMessage mail = new MailMessage(EmailFrom, EmailTo))
        {
            SmtpClient SmtpServer = new SmtpClient();
            mail.Subject = "Password Reset";
            mail.Body = "<br/>Your new temporary password is: Pass12345<br/><br/>";
            mail.IsBodyHtml = true;
            SmtpServer.Host = "10.98.0.147";
            SmtpServer.UseDefaultCredentials = true;
            SmtpServer.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
            SmtpServer.Port = 25;
            SmtpServer.EnableSsl = false;

            SmtpServer.Send(mail);
        }
    }

Viewing all articles
Browse latest Browse all 29758

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>