I have the following CDONTS code that works fine:
Dim CDONTSMail
Set CDONTSMail = CreateObject("CDONTS.NewMail")
CDONTSMail.From= "[email protected]"
CDONTSMail.To= "[email protected]"
CDONTSMail.Subject= "500.100 Error: " & objASPError.File
strBody = "This is a test message." & vbCrLf
CDONTSMail.Body= sErrorMes
CDONTSMail.Send
set CDONTSMail=nothing
However the following when used in a loop errors out? any ideas?
'Create Mailer object and send message
CDONTSMail.From= "[email protected]"
CDONTSMail.To = Session("Email")
CDONTSMail.Subject = Subject
strBody = MainMessage & vbCrLf
CDONTSMail.Body= strBody
CDONTSMail.Send
You need to set CDONTSMail again.
Try this in your loop:
Set CDONTSMail = CreateObject("CDONTS.NewMail")
CDONTSMail.From= "[email protected]"
CDONTSMail.To= "[email protected]"
CDONTSMail.Subject = Subject
strBody = MainMessage & vbCrLf
CDONTSMail.Body= strBody
CDONTSMail.Send
set CDONTSMail=nothing