0
votes

I have appx. 200-300 mails to send and using Set myMail=CreateObject("CDO.Message") to send messages in while loop.

But due to large number of mails - It gives internal server error after sending 50-60 mails and then other emails are not sent successfully.

What I have to do for allowing it to send 100+ emails in classic ASP?

  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
What error, and why? Is the server rejecting the sender due to "spam" reasons?user2246674
For something like this, you'd be better off using a mass email service like MailChimp, as you won't run into spam filtering problems.Dai
internal server error .. if 60+ mails in loop.k-s
You need increase script execution time by setting property Server.ScriptTimeout. Also, wrap up myMail.send in on error statetement and manually check errors.VMV
ok let me give it a tryk-s

1 Answers

0
votes

I ran into the same problem. Check out this page:

<%
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>