Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send to Multiple CC Recipients separated by a comma in a text box

Status
Not open for further replies.

Taco

Programmer
Apr 1, 2001
32
US
I am trying to figure out a way to send email to mutiple CC recipients that are listed in a text box separated by a comma. I can get the Mailer.AddCC "", Request.Form("ccemail") with a single address in the text box but everything I have tried to do using a comma as a delimiter the address shows up as two addresses in one. Please help.
 
What email client are you using?

FWIW, some clients use a semicolon as the address delimiter. Jon Hawkins
 
If the Mail COMponent has a delimiter other than comma, then use the split() function to convert your email list as an array; then use a for loop to reconstruct the list.
I guess you are using Persits.ASPMail

Thank you...
RR

 
I am using ASP Mail and the problem I am having is the Mailer.AddCC interprets multiple recipients as one long address. For instance if I put in email1@company.com, email2@company.com when it sends the email the CC address looks like <email1@company.com, email2@company.com>. Again my code just says Mailer.AddCC &quot;&quot;, Request.Form(&quot;ccemail&quot;). Do you have an example as to how I would use the split() function? I am just beginning with ASP mail and Active Server Pages. Thank you.
 
With ASPmail, each new CC address needs to be added by a new line of
mailer.AddCC ....

Therefore, if you have a comma separated list, you need first to split this into an array around the commas (ensure spaces are removed with a replace function first if necessary):

CCarray = split(strListofCCaddresses,&quot;,&quot;,-1)

Then cycle through them something like this:

i=0
Do while i<Ubound(CCarray)
mailer.AddCC CCarray(i)
i=i+1
loop

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top