كيفية إرسال البريد من ASP.NET مع IIS6 SMTP في خادم مخصص؟

StackOverflow https://stackoverflow.com/questions/97840

  •  01-07-2019
  •  | 
  •  

سؤال

أحاول تكوين خادم مخصص يقوم بتشغيل 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"); %>    

ثم أضفت ما يلي إلى ملف 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 الذي يأتي معه.

هل يمكن أن تخبرني ما الذي يجب تغييره لإصلاح المشكلة؟

شكرًا


@ماتلانت

هذا خادم مخصص ولهذا السبب أقوم بتثبيت SMTP يدويًا.

يحرر:أستخدم Exchange ، لذا فهي مختلفة قليلاً ، ولكنها تسمى مضيفًا ذكيًا في المقابل ، ولكن في تكوين خدمة SMTP العادي ، أعتقد أنه يطلق عليه شيء آخر.لا أستطيع تذكر بالضبط اسم الإعداد.

شكرًا لك على توجيهي إلى حقل المضيف الذكي.يتم تسليم البريد الآن.

في خصائص خادم SMTP الظاهري الافتراضي، في علامة التبويب "التسليم"، انقر فوق "خيارات متقدمة" وقم بملء حقل "المضيف الذكي" بالعنوان الذي يقدمه لك مزود الخدمة الخاص بك.في حالتي (GoDaddy) كان k2smtpout.secureserver.net.

مزيد من المعلومات هنا: http://help.godaddy.com/article/1283

هل كانت مفيدة؟

المحلول

أجد أن أفضل شيء يعتمد عادةً على مقدار البريد الإلكتروني الموجود هو إعادة توجيه البريد عبر خادم SMTP الخاص بمزود خدمة الإنترنت.صداع أقل.يبدو أن هذا هو المكان الذي تواجه فيه مشكلات، بدءًا من SMTP الخاص بك إلى الخوادم الخارجية، وليس asp.net إلى SMTP الخاص بك.

ما عليك سوى ضبط خادم SMTP الخاص بك لإرساله إلى موفر خدمة الإنترنت (ISP)، أو يمكنك تكوين asp.net لإرساله إليه.

يحرر:أنا أستخدم التبادل لذا فهو مختلف قليلاً، لكنه يسمى مضيفًا ذكيًا في المقابل، ولكن في تكوين خدمة SMTP العادي أعتقد أنه يسمى شيئًا آخر.

لا أستطيع تذكر اسم الإعداد بالضبط.

نصائح أخرى

من خلال مظهر الأشياء، لا يسمح جدار الحماية الخاص بك بخروج SMTP (منفذ TCP 25) من شبكتك.

سؤالان واضحان حقًا (فقط في حالة عدم تغطيتهما) 1.هل تم تعطيل جدار الحماية الخاص بالويندوز؟2.هل لديك جدار حماية شخصي/خاص بالشركة يمنع إرسال بريدك؟

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top