• Status: Solved
  • Priority: Low
  • Security: Public
  • Views: 100
  • Last Modified:

Not able to Add CC or BCC in the VBS scrip to send emails.

Dim olkApp, olkSes, olkMsg
Set olkApp = CreateObject("Outlook.Application")
Set olkSes = olkApp.GetNamespace("MAPI")
olkSes.Logon olkApp.DefaultProfileName
Set olkMsg = olkApp.CreateItem(0)
With olkMsg
      'On the next line enter the email address of the person you want to send to'
      .Recipients.Add "someone@company.com"
      'On the next line enter the email subject'
      .Subject = "Some Subject"
      'On the next line enter your message.  You can use HTML formatting.'
      .HTMLBody = "Your message goes here."
End With
Set olkMsg = Nothing
Set olkSes = Nothing
Set olkApp = Nothing

Not able to Add CC or BCC in this code
Appy g
Appy g
  • 2
  • 2
1 Solution
abbas abdullaCommented:
Have you tried
.CC= "Somone@somewhere.com"
.BCC= "Somone@somewhere.com"
Appy gAuthor Commented:
i tried. Not working.
Appy gAuthor Commented:
it worked. there was a syntax errror and it worked like a treat :D Thanks alot
abbas abdullaCommented:
I tried and it's working for me!
can you try this
olkMsg.CC= "someone@company.com"
olkMsg.BCC= "someone@company.com"
Seth SimmonsSr. Systems AdministratorCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Appy g (https:#a42451154)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

Experts-Exchange Cleanup Volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now