【问题标题】:Sending Mail With asp用asp发送邮件
【发布时间】:2014-08-02 10:52:34
【问题描述】:

我正在使用以下代码发送电子邮件。问题是它向所有域(如 gmail、live、yahoo 等)发送电子邮件。它正在正确发送电子邮件,但是当我将其发送到我的域时,它向我显示了一个错误。

由于发生内部服务器错误,页面无法显示。
set omail = Server.CreateObject("CDO.Message")
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Confi = objConfig.Fields
confi("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
Confi("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
confi("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Confi.Update
Set omail.Configuration = objConfig
'omail.To = "ABC@gmail.com"
omail.To = "ABC@ABCXYZ.com"
omail.From = Test@gmail.com"
omail.subject = "From : Test"
omail.TextBody = vBody
omail.Send

我找不到问题。

【问题讨论】:

  • 根据您使用的 IIS 版本,您需要“将错误发送到浏览器”,甚至可能需要在所有请求的自定义错误下设置“详细错误”。目前,您没有获得有关正在发生的 HTTP 500 错误的任何详细信息。

标签: email vbscript asp-classic


【解决方案1】:

在问题中添加语法高亮显示问题;

omail.From = Test@gmail.com"

应该是

omail.From = "Test@gmail.com"

您缺少一个双引号 (") 来启动字符串,这将导致 VBScript 中出现语法错误,进而从 IIS 生成 HTTP 500 Internal Server Error

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-19
    • 1970-01-01
    相关资源
    最近更新 更多