如何在专用服务器上使用IIS6 SMTP从ASP.NET发送邮件?

如何在专用服务器上使用IIS6 SMTP从ASP.NET发送邮件?,asp.net,iis,smtp,Asp.net,Iis,Smtp,我正在尝试配置一个运行ASP.NET的专用服务器,以通过本地IIS SMTP服务器发送邮件,但邮件被卡在队列文件夹中,无法传递 我在.aspx页面中使用此代码来测试: <%@ Page Language="C#" AutoEventWireup="true" %> <% new System.Net.Mail.SmtpClient("localhost").Send("info@thedomain.com", "jcarrascal@gmail.com", "tes

我正在尝试配置一个运行ASP.NET的专用服务器,以通过本地IIS SMTP服务器发送邮件,但邮件被卡在队列文件夹中,无法传递

我在.aspx页面中使用此代码来测试:

<%@ Page Language="C#" AutoEventWireup="true" %>

<% new System.Net.Mail.SmtpClient("localhost").Send("info@thedomain.com", 
    "jcarrascal@gmail.com", "testing...", "Hello, world.com"); %>    
最后,我运行SMTPDiag.exe工具,如下所示:

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.
我正在使用ASP.NET2.0、Windows2003Server和它附带的IIS

你能告诉我还需要做些什么来解决这个问题吗

谢谢


@马特兰特

这是一个专用服务器,这就是我手动安装SMTP的原因

编辑:我使用exchange,所以它有点 不同,但它被称为智能主机 在交换中,但在普通SMTP服务中 我想这叫什么 其他的我记不清确切的日期了 设置名称

感谢您为我指出智能主机领域。邮件现在正在投递

在默认SMTP虚拟服务器属性的“传递”选项卡中,单击“高级”,并用提供商提供的地址填充“智能主机”字段。在我(GoDaddy)的例子中,它是k2smtpout.secureserver.net


更多信息:

我发现最好的办法通常取决于电子邮件的数量,就是通过ISP的SMTP服务器转发邮件。减少头痛。看起来这是您遇到问题的地方,从SMTP到外部服务器,而不是asp.net到SMTP

只需将SMTP服务器设置为发送到ISP,或者您可以配置asp.net以发送到ISP

编辑:我使用exchange,所以它有点不同,但它在exchange中被称为智能主机,但在普通SMTP服务配置中,我认为它被称为其他东西


我记不清确切的设置名称。

从外观上看,您的防火墙不允许SMTP(TCP端口25)从您的网络中退出。

两个非常明显的问题(以防它们没有被涵盖) 1.windows防火墙是否已禁用? 2.您是否有阻止邮件发送的个人/公司防火墙

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
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.