error '8004020f' while sending to multiple emails in ASP - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

error '8004020f' while sending to multiple emails in ASP

I am developing an emailing form in which i am restricting the sender only to mail on a specific domain. user can send a message to multiple recipients.
It works fine for 3 emails and sometimes 4 email addresses, but as the number of emails increased in oMail.To it give me error '8004020f' on oMail.send line.

Here is my code:
Set oMail = Server.CreateObject("CDO.Message")
oMail.Configuration.Fields.Item ("")= 2
oMail.Configuration.Fields.Item ("") =""
'Server port
oMail.Configuration.Fields.Item ("") =25
oMail.Configuration.Fields("") = 60
' If your server requires outgoing authentication uncomment the lines below and use a valid email address and password.
oMail.Configuration.Fields.Item ("") = 1 'basic (clear-text) authentication
oMail.Configuration.Fields.Item ("") ="[email protected]"
oMail.Configuration.Fields.Item ("") ="*************"

Dim emlArray
Dim arraysize, emlloop
emlArray = split (eml,";")
arraysize = UBound(emlArray)

'Start of emailing loop
For emlloop = 0 to arraysize
emlArray(emlloop) = trim(emlArray(emlloop))

oMail.To = ""& emlArray(emlloop) &""
oMail.From = "[email protected]"
oMail.Subject = "Shift Activity Report"
oMail.TextBody = "text body" //uncomment for using
If Err.number <> 0 Then
End if
'end of emailing loop

Set oMail = Nothing
Sign In or Register to comment.