Click to See Complete Forum and Search --> : want to send mail from local computer(localhost) in ASP.NET 2.0 using..


bhuraasif
May 15th, 2007, 07:27 AM
Hi everyone


I have been trying to send email from local computer(localhost).but i couldnt succeed.

here is code


Please help me to send mail from local computer(localhost) using SmtpClient.

MailMessage msg = new MailMessage("asifondemand@yahoo.com", "asifondemand@yahoo.com");

SmtpClient smcl = new SmtpClient();
smcl.Host = "localhost";
smcl.Port = 25;
msg.Body = "testing to send bulk mail";

msg.Subject = "bulk mail";
msg.Priority = MailPriority.High;
msg.IsBodyHtml = false;
msg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;

smcl.UseDefaultCredentials = true;
smcl.Send(msg);

but it give me error,

Please help me or show me some article.

Regards,
ASIF

mcmcom
May 15th, 2007, 03:57 PM
How about you tell us the error? Its pretty hard to help you without knowing what the error is.

Also do you have SMTP Set up on this computer?

mcm