Hi ,
this is my code for sending email that doesn't work . When I click the Send button it dosen't give me error , but whene I'm checkeing my email, nothing thier.
protected void submit_Click(object sender, EventArgs e){
MailMessage msg = new MailMessage();msg.From =
new MailAddress("[email protected]");msg.To.Add (
new MailAddress(txtEmail.Text.Trim()));msg.Subject = txtLast.Text.Trim();
msg.Body = txtComment.Text.Trim();
msg.IsBodyHtml =
false; SmtpClient smpt = new SmtpClient();smpt.Send(msg);
}
and this is my Web.Config
<
system.net><
mailSettings><
smtp><
network host="127.0.0.1"/> smtp> mailSettings> system.net>After two days I'll appreciate any help
Thanks mali
Blocked AccountPosted Feb 9, 2009, 10:56 PM
I have made some changes in your code try this.
protected void submit_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
MailAddress fromAddress = new MailAddress("[email protected]");
msg.From = fromAddress;
msg.To.Add (txtEmail.Text.Trim());
msg.Subject = txtLast.Text.Trim();
msg.Body = txtComment.Text.Trim();
SmtpClient smpt = new SmtpClient();
smpt.Host = "localhost" ;
smpt.Send(msg);
}
maliPosted May 10, 2009, 3:13 PM
Thanks for replay (to all)
I'll will try your suggestions
Robert WoodliffPosted May 10, 2009, 2:47 PM
Robert WoodliffPosted May 10, 2009, 2:36 PM