Hi!,
This is my code which i have used.
protected void Send_Email(Object Sender, EventArgs e) {
MailMessage mail = new MailMessage();
mail.To = Request.Form["to"];
Response.Write(Request.Form["to"]);
mail.From = Request.Form["from"];
Response.Write(Request.Form["from"]);
if(Request.Form["format"].Equals("text"))
mail.BodyFormat = MailFormat.Text;
else
mail.BodyFormat = MailFormat.Html;
mail.Subject = Request.Form["subject"];
mail.Body = Request.Form["body"];
SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(mail);
Response.Flush();
Message.Text = "Message Sent...<br><br>" +
"<a href=\"sendMail.aspx\">Go Back";
}
i have followed all your instructions regarding relay and localhost but all in vain. I am not getting any error msg and "Send..." is always displayed, but the mail is not actually send or recieved.
Chandrachur