在 ASP 中发送电子邮件(CDO 消息)每次挂起大约 5 到 10 秒
我正在使用此代码发送电子邮件:
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sign-up"
myMail.From="[email protected]"
myMail.To="[email protected]"
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
执行此代码时,页面会挂起。大约需要 5 到 10 秒才能继续。如果这是微不足道的,我很抱歉,但我是否需要一个单独的排队机制,因为我在其他网站上不需要这种机制。他们是怎么做的?
I'm sending an email using this code:
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sign-up"
myMail.From="[email protected]"
myMail.To="[email protected]"
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. 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
邮件发送了吗?你说需要几秒钟才能继续 - 你是什么意思?
我查看了一些我所使用的 asp cdo 代码,我认为您必须实例化一个 CDO.Configuration 对象。也许有一个为您设置配置值的函数,例如:
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. Perhaps have a function that sets the config values for you, something like: