J'essaie de configurer un serveur dédié qui exécute ASP.NET pour envoyer du courrier via le serveur SMTP IIS local, mais le courrier est bloqué dans le dossier file d'attente et n'est pas distribué.Comment envoyer du courrier depuis ASP.NET avec IIS6 SMTP dans un serveur dédié?
J'utilise ce code dans une page .aspx à tester:
<%@ Page Language="C#" AutoEventWireup="true" %>
<% new System.Net.Mail.SmtpClient("localhost").Send("[email protected]",
"[email protected]", "testing...", "Hello, world.com"); %>
Ensuite, j'ajouté ce qui suit au fichier web.config:
<system.net>
<mailSettings>
<smtp>
<network host="localhost"/>
</smtp>
</mailSettings>
</system.net>
Dans le Gestionnaire des services Internet I 'ai changé ce qui suit dans les propriétés du "serveur virtuel SMTP par défaut".
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
Enfin, je lance l'outil SMTPDiag.exe comme ceci:
C:\>smtpdiag.exe [email protected] [email protected]
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 [email protected]
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.
J'utilise ASP.NET 2.0, Windows 2003 Server et IIS qui vient avec elle.
Pouvez-vous me dire quoi d'autre à changer pour résoudre le problème?
Merci
@mattlant
Ceci est un serveur dédié qui est pourquoi j'installer le SMTP manuellement.
EDIT: J'utilise l'échange de sorte que son un peu différent , mais son appelé hôte intelligent en échange, mais dans le service SMTP ordinaire config Je pense que quelque chose appelé autre. Je ne me souviens plus exactement du nom du paramètre .
Merci de m'avoir indiqué le champ Smart host. Le courrier est maintenant livré. Dans les propriétés Serveur virtuel SMTP par défaut, onglet Livraison, cliquez sur Avancé et remplissez le champ "Hôte actif" avec l'adresse fournie par votre fournisseur. Dans mon cas (GoDaddy) c'était k2smtpout.secureserver.net.
Plus d'infos ici: http://help.godaddy.com/article/1283