I create some script to read content or attachments from a Mail account thanks to the people in this forum and it will work on almost all accounts. But I can’t get it to work on my exchange account that I also have in Mail. What must I change in this line to get it working for my 365 account :
set MyMailBox to mailbox "INBOX" of account "MyAccount"
In my other accounts I must always use INBOX, what do you enter as account name for your Exchange account, Exchange is not working. MacExcel the normal account does work
I suspect the account names may be different for different user? Let me explain how I got it. First, I run the following code to get the list of accounts I have:
tell application "Mail" to get the name of every account
On my computer the result is
{"iCloud", "Exchange"}
So my exchange account is named (surprise!) “Exchange”, but maybe on your computer it has a different name? That would explain why it doesn’t work.
Then I want to know the names of mailboxes I have on the account named “Exchange”. So I run the following code:
tell application "Mail" to get the name of every mailbox of account "Exchange"
The result on my computer is a long list of mailboxes I have:
Great now I found the problem, My name is also Exchange but it seems that it use the Dutch folder name from the Inbox on my exchange account on my English Macbook, named “Postvak IN”, when I use that it is working. It show on my MacBook in Mail as “Inbox” so I never thought about it that it use the Dutch name. Thanks for your time