Guys,
I am trying to send an email to multiple users but I don't want to just Bcc them on all the mail as some users use Hotmail and this automatically puts the email in the junk folder if you are Bcc'ed. Therefore, I set up the following code:
Dim objCDO
' Create an email object
Set objCDO = Server.CreateObject("CDONTS.NewMail"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
' Set the generic email options
objCDO.Mailformat=0
objCDO.Bodyformat=0
objCDO.Subject = Request.Form("Subject"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
objCDO.From = myEmail
' Send the email to each user
do while not rs.EOF
objCDO.Body = MailBody(rs("UserName"
) line 221
objCDO.To = rs("Email"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
objCDO.Send
Recipients = Recipients & rs("Email"
& ", "
rs.MoveNext
loop
set objCDO = nothing
Using the Recipients variable, I can see that it is generating the email addresses correctly. However, when I run this code, it always sends the email to the first person and then fails with the following error:
error '80040108'
/intranet/admin/sendEmail.asp, line 221
Can I send emails like this using CDO?? Mise Le Meas,
Mighty![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I am trying to send an email to multiple users but I don't want to just Bcc them on all the mail as some users use Hotmail and this automatically puts the email in the junk folder if you are Bcc'ed. Therefore, I set up the following code:
Dim objCDO
' Create an email object
Set objCDO = Server.CreateObject("CDONTS.NewMail"
' Set the generic email options
objCDO.Mailformat=0
objCDO.Bodyformat=0
objCDO.Subject = Request.Form("Subject"
objCDO.From = myEmail
' Send the email to each user
do while not rs.EOF
objCDO.Body = MailBody(rs("UserName"
objCDO.To = rs("Email"
objCDO.Send
Recipients = Recipients & rs("Email"
rs.MoveNext
loop
set objCDO = nothing
Using the Recipients variable, I can see that it is generating the email addresses correctly. However, when I run this code, it always sends the email to the first person and then fails with the following error:
error '80040108'
/intranet/admin/sendEmail.asp, line 221
Can I send emails like this using CDO?? Mise Le Meas,
Mighty