Send Mail With Gmail

Started by VelMurugan, Dec 18, 2008, 11:48 AM

previous topic - next topic
Go Down

VelMurugan

Send Mail With Gmail

Code: [Select]
using System;
using System.Collections.Generic;
using System.Text;

namespace PAB.SEO
{
public static class GmailSender
{
public static void SendGmail(string userName, string password, string mailFrom, string mailTo, string commaDelimCCs, string subject, string message, bool isBodyHtml)
{
System.Net.Mail.MailMessage msg = new
System.Net.Mail.MailMessage(mailFrom, mailTo,
subject, message);
msg.IsBodyHtml = isBodyHtml;
if(commaDelimCCs!="")
msg.CC.Add(commaDelimCCs );
System.Net.NetworkCredential cred = new
System.Net.NetworkCredential(userName, password);
System.Net.Mail.SmtpClient mailClient = new
System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
mailClient.EnableSsl = true;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = cred;
mailClient.Send(msg);
}
}
}

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:
Verification:
Please leave this box empty:

Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

shortcuts: alt+s submit/post or alt+p preview
IT Acumens Web Designing Chennai | GinGly :: Build your Personal Website | CineBuzz :: Cinema News | My Kids Diary :: Kids Memories Writing :: Book Website @ 349 Rs monthly
Copyright 2005 - 2020 :: IT Acumens :: All Rights Reserved. :: Sitemap
ITAcumens Discussion Forum with 2 lakhs post running for 15 years - Powered by IT Acumens Dedicated Server