【问题标题】:configuring smtp in iis 7 for sending emails from classic asp application在 iis 7 中配置 smtp 以从经典 asp 应用程序发送电子邮件
【发布时间】:2011-09-21 20:36:57
【问题描述】:

我想在 iis7 上配置 smtp 服务器。它是一个在经典 asp 上完成的网站,我从中发送电子邮件。我得到的错误代码为-2147220973。

我已在 IIS 7 中配置了电子邮件地址和 stmtp 服务器名称

还有什么需要配置的吗?或者错误代码是什么意思?

【问题讨论】:

    标签: iis-7 asp-classic smtp


    【解决方案1】:

    CDOSYS 错误:错误号: -2147220973 错误来源:CDO.Message.1 错误描述: 传输无法连接到 服务器。

    看起来 IIS 无法连接到 SMTP 服务器,请确保您使用的是正确的 SMTP 服务器,一些 Web 主机,例如 GoDaddy 要求您使用他们的 SMTP 服务器来控制垃圾邮件问题。检查您的网络主机支持文档。还有 CDOSYS,在 ASP 中使用的电子邮件组件不会读取 IIS 配置,就像在用于 ASP.NET 而不是 ASP Classic 的 IIS 7 中一样。 IIS 7 默认配置为使用 localhost。

    查看下面的代码并确保您的代码使用正确的 SMTP 服务器。

    <%
    Set myMail=CreateObject("CDO.Message")
    myMail.Subject="Sending email with CDO"
    myMail.From="mymail@mydomain.com"
    myMail.To="someone@somedomain.com"
    myMail.TextBody="This is a message."
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
    'Name or IP of remote SMTP server
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.server.com"
    'Server port
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 
    myMail.Configuration.Fields.Update
    myMail.Send
    set myMail=nothing
    %>
    

    http://www.w3schools.com/asp/asp_send_email.asp

    我还编写了一个简单的 ASP 函数,它使用 Dictionary 对象通过 CDOSYS 发送电子邮件。这可以使在 ASP Classic 中发送电子邮件更容易一些。

    http://www.simplecontactus.com

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-17
      • 1970-01-01
      • 2012-12-17
      • 1970-01-01
      • 2012-05-19
      • 1970-01-01
      • 2013-02-17
      • 1970-01-01
      相关资源
      最近更新 更多