从经典 ASP 发送电子邮件

发布于 2024-12-11 07:10:36 字数 1280 浏览 0 评论 0原文

已解决:两名学生给了我们错误的电子邮件,并且出于某种原因,如果脚本遇到错误的电子邮件,则拒绝处理更多内容。我还是想知道为什么会这样!

我正在尝试从数据库中读取一堆记录,对于每条记录,我都会根据记录的某些字段创建一些文本,然后将它们作为电子邮件发送到记录中提供的电子邮件地址。 问题是电子邮件只发送了大约 5-10 条记录(情况有所不同,一旦发送了 5 封电子邮件,并抄送了所有内容,第二天就发送了 7 封)。 之后它出现了著名的错误:

错误“8004020f”<​​br> /sendEmail.asp,第 139 行 我在互联网

上进行了研究,发现很多人都遇到了这个错误,但不是我遇到的那种,发送了很少的电子邮件,然后就停止了。 此外,所有电子邮件都发送到同一域,即学生的官方学校电子邮件。

有什么想法吗?我可能想要求网站托管人员更改任何设置吗?

这是代码。



    Dim objMail
    Set objMail = CreateObject("CDO.Message")
    objMail.From= "someEmail"
    objMail.To=rstemp("Email")
    objMail.Cc = "someEmail"

    objMail.Subject = subjecttext
    objMail.HTMLBody=tempData

    objMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing")= 2
    'Name or IP of remote SMTP server

    objMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.*"
    'Server port

    objMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25

    objMail.Configuration.Fields.Update

    objMail.Send

    set objMail=nothing
    tempData = nothing
 

编辑:在更多调试中,事实证明,当我将 objMail.To 从发送到每个学生的电子邮件替换为我自己的电子邮件时。它工作正常并将所有电子邮件发送给我。

SOLVED: Two students gave us the wrong emails, and for some reason the script refused to process more if it encountered a wrong email. I am still wondering why is it so !

I am trying to read a bunch of records from a database, and for each record I am creating some text based on some fields of the record and then sending them as email to the email address provided in the record.
The problem is the email gets sent for only about 5-10 records (it varies, once it sent 5 emails, with cc and everything, next day it sent 7).
After this it comes up with the famous error:


error '8004020f'
/sendEmail.asp, line 139

I have researched all around the internet, and I see many have issues with this error, but not the kind that I am having, in which few emails are send and then it stops.
Also, all emails are being sent to the same domain, the official school email of the students.

Any ideas? Any settings that I might want to ask the website hosting guy to change?

Here is the code.



    Dim objMail
    Set objMail = CreateObject("CDO.Message")
    objMail.From= "someEmail"
    objMail.To=rstemp("Email")
    objMail.Cc = "someEmail"

    objMail.Subject = subjecttext
    objMail.HTMLBody=tempData

    objMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing")= 2
    'Name or IP of remote SMTP server

    objMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.*"
    'Server port

    objMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25

    objMail.Configuration.Fields.Update

    objMail.Send

    set objMail=nothing
    tempData = nothing
 

EDIT: On more debugging, it turns out that when I replace the objMail.To from sending it to each student's email to my own email. It works fine and sends all the emails to me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沦落红尘 2024-12-18 07:10:36

请首先检查所有电子邮件是否有效,并且没有测试电子邮件。您可以通过在同一电子邮件地址上发送所有电子邮件来测试它,无需这样做。时间并可以跟踪该电子邮件地址问题或其他问题。

Please check first all the Emails is valid and no test email is there. and you can test it with send all emails on same email address for no. of time and can track the problem that is this Email address problem or something else.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文