Results 1 to 2 of 2
2015-05-29, 07:42 #1
- Join Date
- May 2015
- Thanked 0 Times in 0 Posts
VBA Code to send email from secondary account
I am having trouble with the below code.
ActiveWorkbook.EnvelopeVisible = True
.Item.From = "FOGHelpdesk@quotientclinical.com"
.Introduction = "Hello FOG," & vbNewLine & vbNewLine & "See summary below for upcoming equipment maintenance activities." & vbNewLine & "For a detailed view of upcoming work, please open and check the Equipment Database." & vbNewLine & vbNewLine & "Thanks," & vbNewLine & "Equipment Database."
.Item.To = "firstname.lastname@example.org"
.Item.Subject = "Equipment Database Workload"
I need to get the macro to send the email from a secondary account when a button is pressed within an Excel spreadsheet. The above code works fine without the bold and italic line in place.
2015-05-30, 08:57 #2
- Join Date
- Aug 2010
- Pa, USA
- Thanked 693 Times in 629 Posts
"From" does not appear to be a member of the MailEnvelope class. I can access my address book from the From: field in the envelope window but do not know how to access it programmatically. Of course, the macro recorder picks nothing up when attempting it. My standard code that I use to send emails directly from Excel is almost identical but never had the need to change the From: field.
I know this can be done with an Exchange account or the Mailitem.Sender Property but have never attempted it.
Sorry I could not help,