Forum Moderators: open
<%
from = request.form("from")
body = request.form("body")
subject = request.form("subject")
%>
<%
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = from
objMail.Subject = subject
objMail.To = "hard-code your email address"
objMail.Body = body
objMail.Send
Set objMail = Nothing
Response.redirect "thankyou.asp"
MailMessage mail = new MailMessage();
mail.To = "you@your.com";
mail.From = "me@my.com";
mail.BodyFormat = MailFormat.Html;
mail.Subject = "Testing Email";
mail.Body = "LET ME KNOW IF YOU GET THIS";
SmtpMail.SmtpServer = "relay-hosting.secureserver.net";
SmtpMail.Send( mail );
// Create the message object
MailMessage mail = new MailMessage();
// Add sender and receiver
mail.From = new MailAddress("sender@example.com");
mail.To.Add("receiver@example.com");
//Add the content
mail.Subject = "My Subject";
mail.Body = "Lorem ipsum dolor sit amet";
//Send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Credentials = new NetworkCredential("login", "password");
smtp.Send(mail);
This worked using System.Web.Mail: