Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - BCC looping with CDO
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

BCC looping with CDO

 Post Reply Post Reply
Author
snooper View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 23 April 2002
Location: Israel
Status: Offline
Points: 333
Post Options Post Options   Thanks (0) Thanks(0)   Quote snooper Quote  Post ReplyReply Direct Link To This Post Topic: BCC looping with CDO
    Posted: 09 September 2005 at 9:23am
hi all.


i have a mailer i'm trying to do, that sends out batches of 10 BCC addresses per email.
what i'm doing is reading the adrresses from a DB into an array of 10 fields. then, in my mailer function, i read that array into the BCC field.

is there maybe some kind of format for this? or is it not allowed? all i can get sent is the one regular TO field, the BCCs dont arrive.

below is the code.

thanks!
 
 
 
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")

'This section provides the configuration information for the remote SMTP server.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strMailserver
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/usemessageresponsetext ") = True


' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password.
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="xxxxx"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="xxxxx"

ObjSendMail.Configuration.Fields.Update

'End remote SMTP server configuration section==

ObjSendMail.To = strSendTo & "<" & strSendToEmail & ">" '"someone@someone.net"

'read from array here:
for h = 0 to 9
if BCCemailARR(h) <> "" then
' this tests that the array does actually have contents:
response.Write(h & ":" &  BCCemailARR(h))
if h = 0 then
ObjSendMail.Bcc = h & " <" &BCCemailARR(h) & "> "  '"someone@someone.net"
else
ObjSendMail.Bcc = ObjSendMail.BCC & h & " <" & BCCemailARR(h) & "> " '"someone@someone.net"
end if
end if
next


ObjSendMail.Subject = strSubject
ObjSendMail.From = "HHHHH <postmaster@HHHH>"
ObjSendMail.ReplyTo  = strReplyTo


strEmailBody = "<html dir=""RTL""><head><title>Message</title></head><body>" & strEmailBody &"</body></html>"

ObjSendMail.HTMLBody = doHTML(Server.HTMLEncode(strEmailBody))


ObjSendMail.Send

Set ObjSendMail = Nothing
 
 
 
 
 
PS:, also just tried with semicolon seperators, but no go.
http://msdn.microsoft.com/library/d...30365375a43.asp 
 
 


Edited by snooper - 09 September 2005 at 9:24am
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 11 September 2005 at 7:18pm
if you response.write the value of objsendmail.bcc at the end of the loop, what does it give you?
 
because from what i can see that above isn't going to give you something in the format "email@thing.com,them@there.com,bob@bob.com"
 
using semicolons should work, but you just have to make sure that the actual bcc value is nothing but email addy's and semicolons. It may be something about my complete lack of understanding in arrays, but it looks like the above will give you something like that includes the number of h as well as email addy's, which will screw it up.
 
would something like this work?
 
.bcc = BCCemailARR(h)
else
.bcc = .bcc & ";" & BCCemailARR(h)
 
 
then again, the whole array thing may just have gone straight past me... LOL
Back to Top
snooper View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 23 April 2002
Location: Israel
Status: Offline
Points: 333
Post Options Post Options   Thanks (0) Thanks(0)   Quote snooper Quote  Post ReplyReply Direct Link To This Post Posted: 11 September 2005 at 7:23pm
you're right. i tried with out arrays, and it seems to work. guess i was just complicating myself :)
 
tanks!
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 11 September 2005 at 7:34pm
1st rule of doing anything: never use 10 steps when 1 will do... LOL
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.