从经典ASP发送100多封邮件

时间:2013-06-03 21:25:03

标签: email asp-classic sendmail

我有appx。发送200-300封邮件并使用Set myMail = CreateObject(“CDO.Message”)在while循环中发送消息。

但由于邮件数量众多 - 发送50-60封邮件后内部服务器出现错误,其他电子邮件未成功发送。

我必须做些什么才能让它在经典ASP中发送100多封电子邮件?

  Set myMail=CreateObject("CDO.Message")
                myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
                myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
                myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
                myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
                myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = ""       
                myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = ""
                myMail.Configuration.Fields.Update

            while not rsprofilo.eof 

                myMail.From = ""
                myMail.To = ""
                myMail.Bcc = ""
                myMail.Subject = ""
                myMail.HTMLBody = ""

                myMail.Send

                rsprofilo.movenext
            wend

    set myMail = nothing

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。 看看这个页面:

<%
ID_template= request.querystring("ID_template")
s_resume=request.querystring("resume")
s_file = "admin_email_send_go.asp?ID_template=" & ID_template
if (s_resume="yes") then s_file = "admin_email_send_resume.asp?ID_template=" & ID_template
%>
<html>
<head>
<meta http-equiv="Refresh" content="<%=int(session("n_records")/50)%>; url=<%=s_file%>">
    <script type="text/javascript">
    <!--
    function delayer(){
    document.location = "<%=s_file%>"
    }
    //-->
    </script>
</head>
<body onLoad="setTimeout('delayer()',<%=int(session("n_records")*20)%>)" bgcolor='#FFFFFF'>
<br>
<table width='100%' height='100%'>
<tr>
<td valign=middle align=center>
    <table border=1>
    <tr>
    <td>
        Total list size: <%=session("n_records")%><br>
        Sent so far: <%=session("n_records_sent")%>
    </td>
    </tr>
    </table><br>
    <br>
    Sending next group of <%=application("email_group_size")%> in 2 seconds.<br>
    Please wait...<br>
    <br>
    If you want to quit or pause the process at any time, click <a href='admin_email_send.asp?ID_template=<%=ID_template%>'>here</a>.<br>
    <br>
</td>
</tr>
</table>
</body>
</html>