I am trying to send email from an ASP.NET web application using the SmtpClient class. So far I have granted relay access to 127.0.0.1. I am trying to send test emails to my gmail account. The EML files get stuck in the mailroot's queue folder. My WinXP firewall is disabled. I dont get any exceptions in the code but the emails are never delivered to the destination address. I also tried other email accounts.
SmtpClient client = new SmtpClient();
client.Host = "127.0.0.1";
MailMessage message = new MailMessage();
message.To.Add("[email protected]");
message.From = "[email protected]";
message.Subject = subject;
message.IsBodyHtml = false;
message.Body = body;
client.Send(message);
Here is a snippet from the IIS SMTP log.
Software: Microsoft Internet Information Services 5.1
Version: 1.0
Date: 2009-01-16 18:28:28
Fields: time c-ip cs-method cs-uri-stem sc-status
18:28:28 127.0.0.1 EHLO - 250
18:28:28 127.0.0.1 MAIL - 250
18:28:28 127.0.0.1 RCPT - 250
18:28:28 127.0.0.1 DATA - 250
18:29:45 127.0.0.1 MAIL - 250
18:29:45 127.0.0.1 RCPT - 250
18:29:45 127.0.0.1 DATA - 250
18:30:37 127.0.0.1 QUIT - 0