using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Net.Mail; public partial class Email : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btn_Send_Click(object sender, EventArgs e) { MailAddress from = new MailAddress(txt_From.Text); MailAddress to = new MailAddress(txt_To.Text); MailAddress cc = new MailAddress(txt_cc.Text); MailAddress bcc = new MailAddress(tx_bcc.Text); MailMessage msg = new MailMessage(); msg.From = from; msg.To.Add(to); msg.CC.Add(cc); msg.Bcc.Add(bcc); msg.Subject = txt_Subject.Text; msg.Body = txt_Body.Text; SmtpClient Smc = new SmtpClient("localhost", 25); Smc.Send(msg); } }