alt
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tech Articles arrow Microsoft.NET arrow Email Sending from Gmail
Site Search


Email Sending from Gmail

Email Sending from Gmail

    This article will focus on following concept
  • Simplest way of sending email from Gmail

.

.

.

.

.

.

.

.

.

.

Simplest Way of Sending Email from Gmail

	protected void btnSendEmail_Click(object sender, EventArgs e)
{
//Create Mail Message Object with content that you want to send with mail.
System.Net.Mail.MailMessage MyMailMessage = 
new System.Net.Mail.MailMessage("your_email_id","friends_email_id", "This is the mail subject", "Just wanted to say Hello"); MyMailMessage.IsBodyHtml = false; //Proper Authentication Details need to be passed when sending email from gmail System.Net.NetworkCredential mailAuthentication = new System.Net.NetworkCredential("your_email_id", "myPassword"); //Smtp Mail server of Gmail is "smpt.gmail.com" and it uses port no. 587 //For different server like yahoo this details changes and you can //get it from respective server. System.Net.Mail.SmtpClient mailClient =
new System.Net.Mail.SmtpClient("smtp.gmail.com",587); //Enable SSL mailClient.EnableSsl = true; mailClient.UseDefaultCredentials = false; mailClient.Credentials = mailAuthentication; mailClient.Send(MyMailMessage);
	    }
- CodeGuru-Dot-Net "Lets make programming easy"  


Trackback(0)
Comments (0)add comment

Write comment

busy
 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape