Send Mail in Inbox from ASP.NET C#

Description



You can send mail programmatically in asp.net.Use 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

<system.net>
<mailSettings>
<smtp from="website name">
<network host="mail.gmail.com" password="Password" userName="userID"/>
</smtp>
</mailSettings>
</system.net>


Comments

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:
    Email: