简体   繁体   English

在ASP(CDO消息)中发送电子邮件每次挂起大约5到10秒

[英]Sending email in ASP (CDO message) hangs about 5 to 10 secs each time

I'm sending an email using this code: 我正在使用以下代码发送电子邮件:

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sign-up"
myMail.From="support@abc.com"
myMail.To="support@abc.com"
myMail.HTMLBody = signup
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.1and1.com"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing

and while this is executed, the page hangs. 执行此操作时,页面挂起。 It takes about 5 to 10 seconds before it moves on. 它需要大约5到10秒才能继续前进。 Apologies if this is trivial but do I need a separate queuing mechanism because I don't this on other websites. 抱歉,如果这是微不足道的,但我需要一个单独的排队机制,因为我不在其他网站上。 How are they doing this? 他们是怎么做到的?

Does the mail get sent? 邮件是否被发送? You say it takes a few seconds before it moves on - what do you mean? 你说它继续前进需要几秒钟 - 你的意思是什么?

I looked at some of my asp cdo code that I have kicking around and I think you have to instantiate a CDO.Configuration object. 我查看了一些我已经开始使用的asp cdo代码,我认为你必须实例化一个CDO.Configuration对象。 Perhaps have a function that sets the config values for you, something like: 也许有一个为你设置配置值的函数,例如:

Function GetConfig()
Dim oConfig
Set oConfig = CreateObject("CDO.Configuration")
oConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    'etc...
     oConfig.Fields.Update
     Set GetConfig = oConfig
End Function

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

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