.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Should i Configure My gmail account to send Email Through C#.net

Posted By: Vikramraj     Posted Date: July 06, 2010    Points:2   Category :C#
I Want to send Email through Gmail Account.

Responses
Author: Sunil Yadav       [Moderator]      
Posted Date: July 06, 2010     Points: 5   

Hi,

Sample code to send email through gmail account.

System.Net.Mail.MailMessage msg = new MailMessage();
msg.From = new MailAddress("yourgmailAccount");
msg.To.Add(new MailAddress("Reciever Email"));
msg.Subject = "Gmail Test" + DateTime.Now.ToShortDateString();
msg.Body = body;
msg.IsBodyHtml = false;

System.Net.Mail.SmtpClient smtp = new SmtpClient();

smtp.Host = "smtp.gmail.com";

smtp.Port = 587;

smtp.Credentials = new System.Net.NetworkCredential("yourgmailAccount", "gmailpassword";
smtp.EnableSsl = true;
smtp.Send(msg);


Author: Don             
Posted Date: January 11, 2011     Points: 5   

no need to configure anything on gmail..



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend