Hi,

I need help to get the email address of the to recipient for sent messages

Here is my Script, but bei the bold marked line I get a type class:unresolved address

What I'm doing wrong ?

Thank you

tell application "Microsoft Outlook"
    
    set accountSpecifier to "Home"
    set mailBoxSpecifier to "INBOX"
    set myMailBox to mail folder "INBOX" of imap account accountSpecifier
    
    set currentMessage to 1st message of myMailBox
    
    set firstMessage to 1
    set lastMessage to (get count of messages in myMailBox)
    set listOfEmails to {}
    
    set StartMessage to 1
    if lastMessage > 10 then
        set StartMessage to (lastMessage - 10)
    end if
    
    repeat with thisMessage from StartMessage to lastMessage
        set currentMessage to message thisMessage of myMailBox
        set theID to id of currentMessage
        set theDate to time sent of currentMessage
        try
            set theSubject to subject of currentMessage
            set theRecipient to email address of to recipient 1 of currentMessage
            log theRecipient

            -- (*address:*** Email address is removed for privacy ***, type class:unresolved address*)

        end try
    end repeat
end tell

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.