Send Email

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I try to send email using this code it seems the code doesn't hhave any
problem but it doesn't send any emailv do you have any idea?

MailMessage objEmail = new MailMessage();
objEmail.To = "(e-mail address removed)";
objEmail.From = "(e-mail address removed)";
objEmail.Cc = "(e-mail address removed)";
objEmail.Subject = "Test Email";
objEmail.Body = "test" ;
objEmail.Priority = MailPriority.High;
SmtpMail.SmtpServer = "localhost";
try
{
SmtpMail.Send(objEmail);
Response.Write("Your Email has been sent sucessfully -Thank You");
}
catch (Exception exc)
{
Response.Write("Send failure: " + exc.ToString());
}
 
Do you have your SMTP Server at "localhost" configured properly? How about
DNS? Does it resolve yahoo.com and hotmail.com? This looks to me like it's
a problem at the SMTP server side of things.
 
Back
Top