using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml; using System.Collections; using System.Web.Mail; using System.IO; /* Copyright (C) Hannon Hill Corporation, hannonhill.com, August 2006 This is a script from hannonhill.com. You will find this and many other scripts at our website as part of our content management system. Terms of use: You are free to use this script as long as the copyright message is kept intact. However, you may not redistribute, sell or repost it without our permission. There are no warranties and you use it at your own risk. */ public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string from = Request.Form["senderEmail"]; string message = "Hello, your friend " + Request.Form["yourName"] + " has sent you the following message:\r\n\r\n" + Request.Form["content"]+"\r\n"+Request.Form["backURL"]; string subject = "Email from your friend"; string to = Request.Form["friendEmail"]; try { System.Net.Mail.SmtpClient mailer = new System.Net.Mail.SmtpClient(); mailer.Host = "66.98.226.18"; mailer.Send(from, to, subject, message); main.Text+="Thank you. The message has been sent."; } catch //(Exception ex) { main.Text="Sorry...the e-mail could not be sent."; } } }