Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · Web Hosting Plans · Faisal Khan's Blog · Contact
Forums : .NET : ASP.NET : not able to send email VERY URGENT!! Signup · Login
Author Thread
not able to send email VERY URGENT!!
Posted in tutorial: Sending E-Mails using ASP.NET
·  chandrachur
User
Joined: 19 Sep 2005
Total Posts: 1
not able to send email VERY URGENT!!
Posted: 19 Sep 2005
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

Users Who Have Visited This Thread In Last 24 Hours
2 Visitors

Login
UserName Or Email Address:       Password:       Auto-Login:    
· Create New User Account
· Send Forgotten Password by Email
 
© 1999 - 2009 Stardeveloper.com, All Rights Reserved.