Domanda

Sto tentando di configurare un server dedicato che esegue ASP.NET per inviare la posta tramite il server SMTP IIS locale, ma la posta rimane bloccata nella cartella Coda e non viene consegnata.

Sto utilizzando questo codice in una pagina .aspx per testare:

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

<% new System.Net.Mail.SmtpClient("localhost").Send("info@thedomain.com", 
    "jcarrascal@gmail.com", "testing...", "Hello, world.com"); %>    

Quindi, ho aggiunto quanto segue al file Web.config:

<system.net>
  <mailSettings>
    <smtp>
      <network host="localhost"/>
    </smtp>
  </mailSettings>
</system.net>

In Gestione IIS ho modificato quanto segue nelle proprietà del "Server virtuale SMTP predefinito".

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

Infine, eseguo lo strumento SMTPDiag.exe in questo modo:

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.

Utilizzo ASP.NET 2.0, Windows 2003 Server e l'IIS fornito con esso.

Potete dirmi cos'altro cambiare per risolvere il problema?

Grazie


@mattlant

Questo è un server dedicato, ecco perché sto installando manualmente l'SMTP.

MODIFICARE:Uso Exchange, quindi è un po 'diverso, ma è chiamato un host intelligente in cambio, ma in semplice configurazione di servizio SMTP penso che si chiami qualcos'altro.Non ricordo esattamente il nome di impostazione.

Grazie per avermi indicato il campo Smart Host.La posta viene consegnata adesso.

Nelle proprietà del server virtuale SMTP predefinito, nella scheda Consegna, fai clic su Avanzate e compila il campo "Smart host" con l'indirizzo fornito dal tuo provider.Nel mio caso (GoDaddy) era k2smtpout.secureserver.net.

Maggiori informazioni qui: http://help.godaddy.com/article/1283

È stato utile?

Soluzione

Trovo che la cosa migliore di solito, a seconda della quantità di posta elettronica presente, sia semplicemente inoltrare la posta tramite il server SMTP del tuo ISP.Meno mal di testa.Sembra che sia lì che riscontri problemi, dal tuo SMTP ai server esterni, non da asp.net al tuo SMTP.

Basta che il tuo server SMTP sia impostato per inviarlo al tuo ISP oppure puoi configurare asp.net per inviarlo.

MODIFICARE:Io uso Exchange quindi è un po' diverso, ma in Exchange si chiama smart host, ma nella semplice configurazione del servizio SMTP penso che si chiami qualcos'altro.

Non ricordo esattamente il nome dell'impostazione.

Altri suggerimenti

A quanto pare il tuo firewall non consente a SMTP (porta TCP 25) di uscire dalla tua rete.

Due domande davvero ovvie (nel caso in cui non siano stati coperti) 1.il firewall di windows è stato disabilitato?2.hai un firewall personale/aziendale che impedisce l'invio della posta?

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top