sweetacid4u
04-11-2009, 03:08 AM
error '8004020f' while sending to multiple emails in ASP Posted by sweetacid4u today at 7:02 PM
Hi,
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:
eml=Request.Form("eml")
Set oMail = Server.CreateObject("CDO.Message")
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")= 2
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="202.163.104.198"
'Server port
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25
oMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
' If your server requires outgoing authentication uncomment the lines below and use a valid email address and password.
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="email@expressnews.tv"
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="*************"
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.Configuration.Fields.Update
oMail.To = ""& emlArray(emlloop) &"@expressnews.tv"
oMail.From = "shift.report@expressnews.tv"
oMail.Subject = "Shift Activity Report"
oMail.TextBody = "text body" //uncomment for using
oMail.Send
If Err.number <> 0 Then
Response.Write(Err.description)
End if
Next
'end of emailing loop
Set oMail = Nothing
Hi,
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:
eml=Request.Form("eml")
Set oMail = Server.CreateObject("CDO.Message")
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")= 2
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="202.163.104.198"
'Server port
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25
oMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
' If your server requires outgoing authentication uncomment the lines below and use a valid email address and password.
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="email@expressnews.tv"
oMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="*************"
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.Configuration.Fields.Update
oMail.To = ""& emlArray(emlloop) &"@expressnews.tv"
oMail.From = "shift.report@expressnews.tv"
oMail.Subject = "Shift Activity Report"
oMail.TextBody = "text body" //uncomment for using
oMail.Send
If Err.number <> 0 Then
Response.Write(Err.description)
End if
Next
'end of emailing loop
Set oMail = Nothing