I'm trying to make a simple loop to work within an email app.
All I would like to do is fill in the BCC field, but the information is created dynamically on the previous page on my website.
So information passed looks like
Request.Form("CompanyEmail") which displays the result email1.com, email2.com
All I am trying to do is put the result into the MyMail.BCC field.
My Code:
Expand|Select|Wrap|Line Numbers
- dim varE, strItem
- varE = Request.Form("CompanyEmail")
- varE= Replace(varE," ","")
- varE = Split(varE,",")
- for each strItem in varE
- Response.Write(strItem)
- MyMail.BCC = MyMail.BCC + strItem
- Next
- Response.Write(MyMail.BCC)
- MyMail.BCC = Replace(MyMail.BCC," ","""")
- Response.Write(MyMail.BCC)
Line 9 displays the result: "email1.com email2.com" (please note the quote marks are created by the progam and not by me)
Line 11 displays the result "email1.com""email2.com "" , """ <">, "email1.com" error '8004020f'
I have no idea where the extra symbols come from on Line11
Because these 2 emails have to go into the BCC field, I have to have them spereated by ""; (eg "email1"; "email2"; (hence line 10)).
Any one got a better idea on how to do this?
Thanks