ローカルIISSMTPサーバーを介してメールを送信するようにASP.NETを実行する専用サーバーを構成しようとしていますが、メールがQueueフォルダーに詰まっていて、配信されません。
このコードを.aspxページで使用してテストしています。
<%@ Page Language="C#" AutoEventWireup="true" %>
<% new System.Net.Mail.SmtpClient("localhost").Send("info@thedomain.com",
"jcarrascal@gmail.com", "testing...", "Hello, world.com"); %>
次に、Web.configファイルに以下を追加しました。
<system.net>
<mailSettings>
<smtp>
<network host="localhost"/>
</smtp>
</mailSettings>
</system.net>
IISマネージャーで、「既定のSMTP仮想サーバー」のプロパティで次のように変更しました。
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
最後に、次のように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.NET 2.0、Windows 2003 Server、およびそれに付属するIISを使用しています。
問題を解決するために他に何を変更するか教えていただけますか?
ありがとう
@mattlant
これは専用サーバーであるため、SMTPを手動でインストールしています。
編集:私は交換を使用しているので少し異なりますが、交換ではスマートホストと呼ばれますが、プレーンSMTPサービス構成では別のものと呼ばれていると思います。設定名を正確に覚えておくことができません。
スマートホストフィールドをご案内いただきありがとうございます。メールは現在配信されています。
[デフォルトのSMTP仮想サーバーのプロパティ]の[配信]タブで、[詳細設定]をクリックし、[スマートホスト]フィールドにプロバイダーから提供されたアドレスを入力します。私の場合(GoDaddy)はk2smtpout.secureserver.netでした。
詳細はこちら: http: //help.godaddy.com/article/1283