How to use SendObject to send to multiple emails but not cc (put in several emails at once...)...?

I have a simple form in an Access db that lets the user put in an email address and then the body in a form, then the send event fires off an email using the SendObject command (using Outlook).

What if the user wanted to be able to put in several emails in a field (comma separated) and hit send, but it would open the Outlook new email for each email, not CC.

So if they put,, and, fill in their body and hit send, three emails would open up (for approval), each to the emails listed above.

How do I do this?

Kevin SmithAsked:
Who is Participating?
Jim Dettman (Microsoft MVP/ EE MVE)Connect With a Mentor PresidentCommented:
SendObject is not using Outlook per say; your using the MAPI interface that was installed by outlook.

You have two basic choices:

1. Call sendobject multiple times.

2. If you want to see the e-mails in Outlook, then you'll send to control Outlook with automation.  ie.  here's one example:

Sub Mail_Outlook(strSendTo As String, strCC as String, strBCC as string, strSubject as String, strBody as String)

    Dim OutApp As Object
    Dim OutMail As Object

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

   On Error Resume Next

    With OutMail
        .To = strSendTo
        .CC = strCC
        .BCC = strBCC
        .Subject = strSubject
        .Body = strbody
        'You can add a file like this
        '.Attachments.Add ("C:\test.txt")
        .Send   'or use .Display
    End With

    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub
Kevin SmithAuthor Commented:
The emails can have different fields if need be...
Kevin SmithAuthor Commented:
nothing happens with option there any prep to using it?
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Kevin SmithAuthor Commented:
How do I call sendobject multiple times?  I've tried simply putting another sendobject command under the other but it doesn't work...still only opens one.
Kevin SmithAuthor Commented:
Wait, the multiple so opens the emails right after each other...any way possible to get them to all open at once?
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
<<Wait, the multiple so opens the emails right after each other...any way possible to get them to all open at once? >>

 Yes, I would think so (have never tried it), but I also think your asking for trouble.  If you sent to 100 people, you'd end up with 100 mail items.

 An alternative approach might be to create each of the mail items, save them to the draft older, then display Outlook and the first item from the folder.

  Personally I'd adress the e-mail to myself in the 'to' and then BCC everyone on the e-mail and deal with one mail item object only.

  But that assumes it's the same e-mail for every receipent.
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.

All Courses

From novice to tech pro — start learning today.