Emailing several recipients

My app generates a string as follows:
EmailList = "John <>;
                  Paul <>;
                  Mary <>"

It then calls the default email browser as follows:

in a module:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) _    As Long

in my procedure:

    WriteEmail = ShellExecute(frmFriendsDirectory.hwnd, "open", "Mailto:", EmailList, "", 1)

This works fine if EmailList has only one address. If it has multiple addresses as above, only the first one is entered.

I have also tried leaving it blank, as follows:

    WriteEmail = ShellExecute(frmFriendsDirectory.hwnd, "open", "Mailto:", "", "", 1)

and then using

SendKeys EmailList, True

this doesn't work either. The closest I get is if I put it on the clipboard as follows:

    Clipboard.SetText EmailList

and then click "Paste" on the browser. In Outlook Express, the keyboard command for Paste is CTRL + V. I also tried Sendkeys "^V" to send that. No luck.

Any suggestions ?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Richie_SimonettiIT OperationsCommented:
Put each entri separated by commas, not as parameter but inside lpFile.
I mean, composse all lpFile parameter like:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gronAuthor Commented:

This appears to work only if I use the format:


But if I use the format:

"Mailto:Mary <>,John <>, Steve <>"

it only registers the first one. Is there a format where I can enter the name and address both ?
Richie_SimonettiIT OperationsCommented:
If you have that list in your address book, you could use name only.
I think you cannot use both with mailto.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Richie_SimonettiIT OperationsCommented:
Also, if you really want to do in a strong way, cahnge your approcah and use this exelent/free component:
Have you played around with CDO or CDONTS?

There is a component I am currently using with exchange srvr. Its cheap and only uses about 3-5 lines of code. 

There are several options with it.
gronAuthor Commented:
I have opted for the first suggestion with email addresses only.
I am still with Vb5, so some of the other options are not available to me.
Richie_SimonettiIT OperationsCommented:
what do you mean with other options?
gronAuthor Commented:
I meant your other suggestion: 

I looked at that, and it is in Vb6. Also, it is far more complex and featured than I require.

Also the suggestion from vwdan2001.
Richie_SimonettiIT OperationsCommented:
No problem, code could be used in VB5 too!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.