简体   繁体   English

cdo.message.send之后的代码无法在经典ASP中执行

[英]Code after cdo.message.send won't execute in classic ASP

Here is my Complete code. 这是我的完整代码。 There is no other code in the entire page. 整个页面中没有其他代码。

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="abcd@example.com"
myMail.To="abc@example.com"
myMail.TextBody="This is a message. "
Response.write "Execution Reached Before Send!"
myMail.Send
Response.write "Execution Reached After Send!"
set myMail=nothing

When I run this asp page, the result I am getting is "Execution Reached Before Send!". 当我运行此asp页时,得到的结果是“发送前已执行!”。 There is no other error messages. 没有其他错误消息。 All I can understand from this is anything after the myMail.Send is not being executed and I am not receiving any emails also. 我只能从此了解到myMail.Send没有执行并且我也没有收到任何电子邮件。

I am using Windows Server 2008 R2 Standard (Service Pack 1). 我正在使用Windows Server 2008 R2 Standard(Service Pack 1)。 SMTP mail server is installed on the local machine. SMTP邮件服务器已安装在本地计算机上。 I created a test email and dropped in "C:\\inetpub\\mailroot\\Pickup" folder and it worked perfectly. 我创建了一封测试电子邮件,并将其放置在“ C:\\ inetpub \\ mailroot \\ Pickup”文件夹中,它工作正常。

The code worked after I added these four lines before the send. 我在发送之前添加了这四行代码,代码工作正常。

myMail.Configuration.Fields.Item ("schemas.microsoft.com/cdo/configuration/sendusing") = 2
myMail.Configuration.Fields.Item ("schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" 
myMail.Configuration.Fields.Item ("schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Fields.Update 

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

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