How to set sender in Outlook pop account


Joined
Feb 13, 2021
Messages
4
Reaction score
0
tell application "Microsoft Outlook"
set theContent to "Mail Content etc."
set theMessage to make new outgoing message with properties {subject:(("Month ") & (do shell script "date '+%m'")), content:theContent}
make new recipient with properties {email address:{address:"(e-mail address removed)"}} at end of to recipients of theMessage
make new recipient with properties {email address:{address:"(e-mail address removed)"}} at end of cc recipients of theMessage
open theMessage
end tell


This script works fine. I like to add a line that picks one of several pop accounts I have so it sends it form that one.

Ideally it selects that account, and the resulting mail has the signature in it that I have stored under that address. Presently it always selects my main account and the signature related to it, but that is not the account I like to send from.

I am stuck here and do not know how to do this, love to hear your suggestions.
 
Ad

Advertisements

Ad

Advertisements

Joined
Feb 13, 2021
Messages
4
Reaction score
0
Here is the solution:

tell application "Microsoft Outlook"
set theAccount to the first pop account whose name is "The-name-of-the-account-you-want-to-use"
set theContent to "Mail Content etc."
set theMessage to make new outgoing message with properties {account:theAccount, subject:"Test", content:theContent}
make new recipient with properties {email address:{address:"(e-mail address removed)"}} at end of to recipients of theMessage
make new recipient with properties {email address:{address:"(e-mail address removed)"}} at end of cc recipients of theMessage
open theMessage
end tell

in case anybody else is looking for this
 

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