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 AccountRank #403 · 6.2K reputationPosted Feb 9, 2009, 5:56 PM EST
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);
}
Robert Woodliff4 reputationPosted May 10, 2009, 10:36 AM EDT
Robert Woodliff4 reputationPosted May 10, 2009, 10:47 AM EDT
mali47 reputationPosted May 10, 2009, 11:13 AM EDT
Thanks for replay (to all)
I'll will try your suggestions