virrion
virrion

Reputation: 424

VBA - Outlook: Send message from one of multiple mailboxes

Here is my problem: - my client has multiple accounts in Outlook 2010 - each account has multiple mailboxes

Example: - Account A: [email protected] - under neath of that account he has the following mailboxes associated: 1. Support [email protected] 2. Contact [email protected] ....

What I need to accomplish is to send email using VBA and have the message being sent as FROM [email protected]. My client is using Exchange server. Unfortunately I do not have an Exchange server so I cannot test that.

Would you happen to have any idea?

Here is my current code used to set account (but only account not a mailbox associated / underneath of that account):

mailItem.sendUsingAccount = application.session.accounts.item("Contacts)

That part work and results with FROM: [email protected]. However, I do not know how to send an email so it reads FROM: [email protected].

Thank you.

Upvotes: 0

Views: 4798

Answers (1)

AxGryndr
AxGryndr

Reputation: 2344

I believe that you can set the .SendOnBehalfOfName to the address you want to use.

Doing this will prompt the user to confirm access to the Mailitem.

Upvotes: 2

Related Questions