简体   繁体   English

用asp发送邮件

[英]Sending Mail With asp

I am using the following code for sending email. 我正在使用以下代码发送电子邮件。 The problem is that its sending email to all domains like gmail, live, yahoo, etc.. It's sending the email properly, but when I am sending it to my domain, it's showing me an error. 问题是它向所有域(例如gmail,live,yahoo等)发送电子邮件。它正在正确发送电子邮件,但是当我将其发送到我的域时,却向我显示错误。

The page cannot be displayed because an internal server error has occurred.
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

I can not find the problem. 我找不到问题。

Adding syntax highlighting to the question shows up the problem; 向问题中添加语法高亮显示问题。

omail.From = Test@gmail.com"

Should be 应该

omail.From = "Test@gmail.com"

You're missing a double quote ( " ) to start the string, this will cause a syntax error in VBScript which will in-turn generates a HTTP 500 Internal Server Error from IIS. 您缺少双引号( " )来启动字符串,这将在VBScript中导致语法错误,从而从IIS生成HTTP 500 Internal Server Error

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM