• 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"
      .Recipients.ResolveAll
      '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."
      .Send
End With
Set olkMsg = Nothing
olkSes.Logoff
Set olkSes = Nothing
Set olkApp = Nothing

Not able to Add CC or BCC in this code
0
Appy g
Asked:
Appy g
  • 2
  • 2
1 Solution
 
abbas abdullaCommented:
Hi,
Have you tried
.CC= "Somone@somewhere.com"
.BCC= "Somone@somewhere.com"
0
 
Appy gAuthor Commented:
i tried. Not working.
0
 
Appy gAuthor Commented:
it worked. there was a syntax errror and it worked like a treat :D Thanks alot
0
 
abbas abdullaCommented:
I tried and it's working for me!
can you try this
olkMsg.CC= "someone@company.com"
olkMsg.BCC= "someone@company.com"
0
 
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.

seth2740
Experts-Exchange Cleanup Volunteer
0
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