How to e-mail confirmation notices to Outlook with cc or bcc

D

Dawn Bjork Buzbee

A client uses Access as a training registration system. Currently, they send
training confirmations to the employee's e-mail but now they would like to
include the boss/supervisor in the cc or bcc field of the confirmation.
Messages are always generated from a specific e-mail.

Is it possible to sent one e-mail message to multiple people with different
choices in the header?

Any examples or sample code would help us move forward.

Thank you in advance,
Dawn
 
D

Douglas J. Steele

How is the e-mail currently being sent? (There are different ways to do it,
and the answer will depend on what you're currently doing)
 
H

Harry

Hello Dawn,

I do use the outlook as an object.
Within the vba you have to reference to the outlook programm.
please find below an extract of my script.
You can predefine within the string the email-addresses or write them down
within a textbox on your form.

predefining would be something like
dim strAddressCC as string
strAddressCC= "(e-mail address removed)"

taking the address from a form like
dim strAddressCC as string
strAddressCC = me.textboxname
you can define withing the vba the objects on different way's.
I have put a " ' " before the line .TO = (strAddressTO)
removing the ' will result in another aproach however it works fine.
remember to mark the text following with a ' mark otherwise the script will
fail.

success

******* begin code
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim strAddressTO, strAddressCC,strAddressBCC as string
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
' add recepient strAddressTO.
' .To = (strAddressTO)
Set objOutlookRecip = .Recipients.Add(strAddressTO)
objOutlookRecip.Type = olTo
' Add the CC en BCC recipient(s) to the message.
' .CC = (strAddressCC)
Set objOutlookRecip = .Recipients.Add(strAddressCC)
objOutlookRecip.Type = olCC
.BCC = (strAddressBCC)
Set objOutlookRecip = .Recipients.Add(strAddressBCC)
objOutlookRecip.Type = olBCC
end with

' using a checkbox on my form
If Me.PreviewMail = True
Then objOutlookMsg.Display
else
goto Submit

Submit:
..send
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Set objOutlookRecip = Nothing

******* end code

Greetings,
Harry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top