Send Mail in Inbox from ASP.NET C#


You can send mail programmatically in this code to send mail .

///// Import Links

using System.Web.Mail;
using System.Net.Mail;

// write Code in ASPX.CS file

string to = "Receiver address"
string Cc = "another address";
string From = "sender address";
string subject = "subject";
string mess = "Message Body";
SmtpMail.Send(From.ToString(), to.ToString(), subject.ToString(), mess.ToString());

// write code in web.config file

<smtp from="website name">
<network host="" password="Password" userName="userID"/>


Author: ABitSmart07 Dec 2009 Member Level: Gold   Points : 0

Please format your resource.

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: