Link to home
Start Free TrialLog in
Avatar of Bob Schneider
Bob SchneiderFlag for United States of America

asked on


I am trying to send race results to race finishers in classic asp and my script keeps timing out.  I have my Server.ScriptTimeOut set plenty high.  (note that I just added the xmlhttp.SetTimeOuts)  Not sure if I have the other timeout set correctly.  Can someone look at the following code and let me know what changes might help please?  Thans!

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    .Item(cdoSMTPServer) = ""
    .Item(cdoSMTPAuthenticate) = 1
    .Item ("") = 587
    .Item("") = cdoBasic
    .Item(cdoSendUsername) = "username"
    .Item(cdoSendPassword) = "pwd"
End With

    bSentBCC = False

	For j = 0 To UBound(SendTo) - 1
		'get email address
		sMyEmail = vbNullString
		If DontSend(SendTo(j)) = False Then sMyEmail = SendTo(j)

		If Not sMyEmail = vbNullString Then
			If ValidEmail(sMyEmail) = True Then
                sPageToSend = "" & lEventID 

                Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
	       "GET", sPageToSend, false
                    xmlHttp.SetTimeouts 0, 60000, 300000, 300000
	                xmlhttp.send ""
	                EmailContents = xmlhttp.responseText
                Set xmlhttp = nothing

			    Set cdoMessage = CreateObject("CDO.Message")
			    With cdoMessage
				    Set .Configuration = cdoConfig
    				    .To = sMyEmail
				    .From = ""
                   		    .Subject = "Pictures Are Ready for " & sEventName
				    .HTMLBody = EmailContents
			    End With
			    Set cdoMessage = Nothing
		    End If
        End If

    Set cdoConfig = Nothing

Open in new window

Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Bob, I just noticed you are using Mandrill. My bad for not catching that.  In this case, you may be getting an error back from Mandrill that is causing it to time out. Look at your Mandrill admin panel.

Also, they give you two options for sending, SMTP and the API. The API may be less likely to time out.  This is what I was referring to above.

Post here if you are still running into an issue.
Avatar of Bob Schneider


Thanks Scott!