Choose the email account when sending emails via VBA


C

Catalin

Hi everybody,

As I wrote in an earlier post, I have 3 email accounts and use OL2003.
I have several rules which replies automatically to different senders using
different templates. The problem is that the reply uses the default email
account when sending even though I get the initial email through another
account.

The question is: can I somehow determine the incoming account from the
messages received and then reply automatically through the same account? I
hope this can be done with VBA.

Thanks again in advance for your kind reply.

Catalin
 
Ad

Advertisements

G

Gauthier

To specify the From: field using VBA, you can use the MailItem properties
..SenderEmailAddress or .SenderName. You will first have to get the correct
address by searching your 3 addresses in the To: and Cc: field in the
original email using properties .CC and .To.
 
K

Ken Slovak - [MVP - Outlook]

Both of the properties you mention, along with SenderEmailType are read-only
for the Outlook object model and cannot be set in code.

You can use SentOnBehalfOfName in the Outlook object model.

If you are using Extended MAPI or Redemption (www.dimastr.com/redemption)
you can set SenderName or SenderEmailAddress, but not using the Outlook
object model.
 
Ad

Advertisements

K

Ken Slovak - [MVP - Outlook]

And in Outlook 2007 you can use the MailItem.SendUsingAccount property.
 

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