I am trying to configure a dedicated server that runs ASP.NET to send mail through the local IIS SMTP server, but the mail is stuck in the Queue folder and is not delivered.
I use this code on the .aspx page to verify:
<%@ Page Language="C#" AutoEventWireup="true" %> <% new System.Net.Mail.SmtpClient("localhost").Send(" info@thedomain.com ", " jcarrascal@gmail.com ", "testing...", "Hello, world.com"); %>
Then I added the following to the Web.config file:
<system.net> <mailSettings> <smtp> <network host="localhost"/> </smtp> </mailSettings> </system.net>
In IIS Manager, I changed the following in the "SMTP Virtual Server Default" properties.
General: [X] Enable Logging Access / Authentication: [X] Windows Integrated Authentication Access / Relay Restrictions: (o) Only the list below, Granted 127.0.0.1 Delivery / Advanced: Fully qualified domain name = thedomain.com
Finally, I run the SMTPDiag.exe tool as follows:
C:\>smtpdiag.exe info@thedomain.com jcarrascal@gmail.com Searching for Exchange external DNS settings. Computer name is THEDOMAIN. Failed to connect to the domain controller. Error: 8007054b Checking SOA for gmail.com. Checking external DNS servers. Checking internal DNS servers. SOA serial number match: Passed. Checking local domain records. Checking MX records using TCP: thedomain.com. Checking MX records using UDP: thedomain.com. Both TCP and UDP queries succeeded. Local DNS test passed. Checking remote domain records. Checking MX records using TCP: gmail.com. Checking MX records using UDP: gmail.com. Both TCP and UDP queries succeeded. Remote DNS test passed. Checking MX servers listed for jcarrascal@gmail.com. Connecting to gmail-smtp-in.l.google.com [209.85.199.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to gmail-smtp-in.l.google.com. Connecting to gmail-smtp-in.l.google.com [209.85.199.114] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to gmail-smtp-in.l.google.com. Connecting to alt2.gmail-smtp-in.l.google.com [209.85.135.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt2.gmail-smtp-in.l.google.com. Connecting to alt2.gmail-smtp-in.l.google.com [209.85.135.114] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt2.gmail-smtp-in.l.google.com. Connecting to alt1.gmail-smtp-in.l.google.com [209.85.133.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt1.gmail-smtp-in.l.google.com. Connecting to alt2.gmail-smtp-in.l.google.com [74.125.79.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt2.gmail-smtp-in.l.google.com. Connecting to alt2.gmail-smtp-in.l.google.com [74.125.79.114] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt2.gmail-smtp-in.l.google.com. Connecting to alt1.gmail-smtp-in.l.google.com [209.85.133.114] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to alt1.gmail-smtp-in.l.google.com. Connecting to gsmtp183.google.com [64.233.183.27] on port 25. Connecting to the server failed. Error: 10060 Failed to submit mail to gsmtp183.google.com. Connecting to gsmtp147.google.com [209.85.147.27] on port 25. Connecting to the server failed. Error: 10051 Failed to submit mail to gsmtp147.google.com.
I use ASP.NET 2.0, Windows 2003 Server, and IIS that come with it.
Can you tell me what else can be changed to fix the problem?
thanks
@mattlant
This is a dedicated server, so I install SMTP manually.
EDIT: I use sharing to be a little different, but it is called a smart host in exchange, but in a simple SMTP config service, I think this is called something else. I can’t remember exactly the name of the setting.
Thanks for pointing me to the Smart host field. Mail is now delivered.
In the properties of the default SMTP virtual server on the Delivery tab, click Advanced and fill in the Smart Host field with the address provided by your ISP. In my case (GoDaddy) it was k2smtpout.secureserver.net.
Further information here: http://help.godaddy.com/article/1283