Google ads

Monday, January 9, 2012

Send Email in ASP.NET Using Gmail SMTP

Sending mails over asp.net using gmail SMTP

Gmail smtp settings

smtp.gmail.com (use authentication)
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465

Use the above settings for SMTP Client Class properties

If you're having any trouble sending mail but you've confirmed that encryption is active for SMTP in your mail client, try to configure your SMTP server on a different port (465 or 587)

If you enable SSL use 465 or else use 587 (default)

Inline Code

Here is working C# Code

No comments:

Post a Comment