Sending emaikl

  • 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?how can I
configure SMTP Server?

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());
}
 
SmtpMail.SmtpServer = "ip or name of server goes here";

The address that specify has to be an actually working smtp server.
 
I try it nothing happen

Alex Korchemniy said:
SmtpMail.SmtpServer = "ip or name of server goes here";

The address that specify has to be an actually working smtp server.
 
moreover take a look if the localhost is configured. Installing IIs you MUST
choose smtp service as they are not installed by default
So long
 
Back
Top