How to use gmail SMTP in ASP.NET form

You can add this in your web.config file

 <system.net>
    <mailSettings>
      <smtp from="[email protected] ">
        <network host="smtp.gmail.com" defaultCredentials="false"
      port="587" userName ="[email protected]" password="yourpassword" />
      </smtp>
    </mailSettings>
   </system.net>

Leave a Comment