mailSettings, defaultCredentials setup in web.config

Programming, error messages and sample code > ASP.NET
<configuration>
  <system.net>
    <mailSettings>
      <smtp from="YYYYY@xxxxxx.com">
        <network host="mail.xxxxxx.com" port="25" password="password" userName="user@xxxxxx.com" defaultCredentials="false"/>
      </smtp>
    </mailSettings>
  </system.net>
<configuration>

Note: Must set defaultCredentials to false, in order to use smtp authentication.
If the UseDefaultCredentials property is set to false, then the value set in the Credentials property will be used for the credentials when connecting to the server. If the UseDefaultCredentials property is set to false and the Credentials property has not been set, then mail is sent to the server anonymously.