I am trying to send an email from an ASP.NET web application using the SmtpClient class. So far, I have provided relay access to 127.0.0.1. I am trying to send test emails to my gmail account. EML files are stuck in the mailroot queue folder. My WinXP firewall is disabled. I do not receive exceptions in the code, but letters are not 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("myemail@gmail.com");
message.From = "name@domain.com";
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
Jimj
source
share