Send Email using Gmail SMTP server - ASP.NET
Send Email using Gmail SMTP server-ASP.NET What is an SMTP server? (pronounced as separate letters) Short for S imple M ail T ransfer P rotocol, a protocol for sending e-mail messages between servers. Most e-mail systems that send mail over the Internet use SMTP to send messages from one server to another; the messages can then be retrieved with an e-mail client using either POP or IMAP. In addition, SMTP is generally used to send messages from a mail client to a mail server. This is why you need to specify both the POP or IMAP server and the SMTP server when you configure your e-mail application. Let's see one example in ASP.NET 2.0 (Web Application) In WebMailSend.aspx.cs file You have to import this namespace for MailMessage. using System.Net.Mail; protected void btnSend_Click( object sender, EventArgs e) { try { MailMessage mail = new MailMessage(); mail.IsBodyHtml = true ; mail.To.Add(txtEmail.Text); mail.Subject = txtSubject.Text; mail.