Search code examples
vbams-accessoutlookemail

How to change "from" field?


I inherited an Access program that sends emails from my email address.
I want to send from a group email address, say [email protected].

There are two email boxes, mine and the group email.
I changed the default email account in Outlook to use the group email, but it deposits the emails into my draft folder instead of [email protected]'s draft folder.

The code uses this to make an email:

Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
With olMail
    .Subject = stSubject

olMail does not appear to have a .From field.

How can I change the from field or get the macro to recognize the 2nd email box (which I have full rights to)?


Solution

  • Is that a delegate Exchange mailbox? Try to set MailItem.SentOnBehalfOfName property.