Link to home
Start Free TrialLog in
Avatar of simflex
simflex

asked on

Using CDO to cc multiple recipients

This seems so simple but it isn't working.

I am trying to copy multiple recipients in an email but the emails are not getting sent.

I am having problem on the .cc line


Any ideas?


Investigator = Request.form("safetyInvestigator")
riskMan = Request.form("riskManagement")

With iMsg
 Set .Configuration = iConf
     .From = "john.doe@domain.com"
     .To = ""&visoremail&""
     .Sender      = "john.doe@domain.com"
     .cc          = ""&riskMan,investigator&""
     .Subject     = "From President's Office "
     .TextBody    = "Please take care of this ASAP."
       .Send
End With
      if err <> 0 then
            response.write "Error encountered: " & Err.Description
            else
            response.write "<font color='ffffff'>"&visoremail&"</font>"
      end if


Thanks
Avatar of John_Lennon
John_Lennon

change this line
 .cc          = ""&riskMan,investigator&""

to this
 .cc          = """ & riskMan & "," & investigator &"""

or this one, i'm not sure
 .cc          = """ & riskMan & """,""" & investigator &"""

"'&riskMan,investigator&'"


you need single quote '   versus double "
usually emails are seperated by semi-colons, not commas.  i think i have had issues before using commas.
Avatar of simflex

ASKER

If I have it like this:

"" & riskMan & ""

it works but other than that, no love
SOLUTION
Avatar of John_Lennon
John_Lennon

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of simflex

ASKER

sorry folks, I didn't run away. It's just that I have been trying to resolve the error thrown as a result of using any of the formats you guys have suggested.

I keep getting:

error '8004020f'

And it is *only* happening on the cc line.

Others working fine.
Avatar of simflex

ASKER

Thanks to you guys. It is finally working.