0

Can anyone give me some idea why this error show when opening "SMTP E-Mail" on IIS 10 ?

Error: Unrecognized attribute ‘enableSsl’.

Below in what is in the webconfig file and the app runs on .Net 4.0 IIS.

<configuration> 
    <system.net>
        <mailSettings>
            <smtp from="from">
               <network host="host" port="587" enableSsl="true" userName="userName" password="PassWord" defaultCredentials="false"/>
            </smtp>
        </mailSettings>
    </system.net>
</configuration>
Jackdaw
  • 7,626
  • 5
  • 15
  • 33
Zola
  • 21
  • 2
  • 6
  • 2
    First, [do not use the SmtpClient class](https://learn.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?view=net-5.0#remarks). The class's own documentation page strongly warns against it for *several years*. At the very top `The SmtpClient type is now obsolete.`. In the Remarks, in a blue warning box: `We don't recommend that you use the SmtpClient class for new development because SmtpClient doesn't support many modern protocols. Use MailKit or other libraries instead. For more information, see SmtpClient shouldn't be used on GitHub.` – Panagiotis Kanavos Jan 19 '21 at 17:35
  • Second, that's an [XML schema bug](https://stackoverflow.com/questions/36082304/unrecognised-attribute-enablessl-in-net-v4-0) thatt's not going to be fixed since SmtpClient is obsolete. Your code will still run, but you should replace SmtpClient with MailKit anyway – Panagiotis Kanavos Jan 19 '21 at 17:38

0 Answers0