C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Email »

How to send emails through Asp.Net?


Posted Date: 30 Oct 2009    Resource Type: Code Snippets    Category: Email
Author: RajeshMember Level: Bronze    
Rating: 1 out of 5Points: 1



protected void Button1_Click(object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
mail.To.Add("v.rajesh4ever@gmail.com");
mail.To.Add("abc@yahoo.com");
mail.From = new MailAddress("jainamit.agra@gmail.com");
mail.Subject = "Email using Gmail";

string Body = "Hi, this mail is to test sending mail"+
"using Gmail in ASP.NET";
mail.Body = Body;

mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address
smtp.Credentials = new System.Net.NetworkCredential
("xyz@gmail.com","pwd");
//Or your Smtp Email ID and Password
smtp.EnableSsl = true;
smtp.Send(mail);

}



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Mail Sending in Asp.Net?  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Mail sending in asp.net
Previous Resource: Send email in .NET with embedded image
Return to Discussion Resource Index
Post New Resource
Category: Email


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use