Hi!
This problem is driving me crazy: I want AppleScript to create a new message in Mail and use my valid adress “mydomain.com name@mydomain.com" as sender with the following script.
tell application "Mail"
make new outgoing message with properties {sender:"mydomain.com <name@mydomain.com>"}
end tell
But it fails. Mail always picks the default account as sender.
It’s just because of the dot in the name (“mydomain.com”). Variants without the dot work.
I’ve tried two hours already but I’m running out of ideas (I really just don’t want to use the system events clicking function as a workaround).
Help me please.
Is it a POP account or an imap one?
I face the same problem when I wish to send from a POP account.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) lundi 27 mai 2019 22:04:25
It’s a POP account. Do you think it makes a difference with IMAP?
As I wrote, I was never able to have a script setting a pop account as the one used to send.
Now I use only IMAP or iCloud ones.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mardi 28 mai 2019 10:39:04
Ok, but everything works fine for me with POP. Except when there is a dot -->.<-- in the property ‘full name’ of the account I want to send it from.
Below is a working snippet. No problems as long as the ‘full name’ contains no dot.
tell application "Mail"
make new outgoing message with properties {sender:"John Doe <whatever@whatever.com>"}
end tell
(The ‘full name‘ is “John Doe” in this example.)
When I used POP accounts, there was a dot in the full name. Maybe it’s why it failed.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) mardi 28 mai 2019 19:09:24