Changing From Address before sending mail

N

navin

Hi,

I am trying to automate sending emails through excel which works fine
however, one of the requirement is that, before a mail is sent, i need
to change the From address for the mail, since we use different
generic mail ids for sending mails to our customers.

Currently i have to manually enter the From ID before i click on Send.
Below is the code, i am using to create a mail item:

Set olapp = CreateObject("Outlook.Application")
Set olmail = olapp.CreateItem(olMailItem)

olmail.Subject = ""
With olmail
.BodyFormat = olFormatHTML
.HTMLBody =
.To = (e-mail address removed)
'.Display
.Send
End With

Please help!!!

Thank you in advance.

Navin
 

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