0

Following syntax generates email message in apple mail addressed "To" a recipient. Requesting guidance on how to populate the Cc field with 3 additional email addresses. Thanks.

tell application "Mail"
set theNewMessage to make new outgoing message with properties {visible:true, subject:"Update", content:"Hi, Tom. 

All set:
… on the server.

thx. 

-paul."}

tell theNewMessage
    make new to recipient at end of to recipients with properties {address:”[email protected]"}
    activate
end tell
   end tell
1
  • Have you tried adding a new cc recipient to the end of that list? Commented Jan 25 at 15:21

1 Answer 1

0

It took me a while. I have this worked out. I define the sender. I also define the main recipient + 3 cc recipients.

set the_subject to "Update"
set the_body to "Hi, Luciano. 

All set:
… on the server.

thx. 

-lucca."

tell application "Mail"


set new_message to make new outgoing message ¬
    with properties {sender:"MyName  <[email protected]>", 
subject:the_subject, content:the_body, visible:true}


tell new_message
    -- Add the recipients:
    make new to recipient ¬
        at end of to recipients ¬
        with properties {address:"[email protected]"}
    make new cc recipient ¬
        at end of cc recipients ¬
        with properties {address:"[email protected]"}
    make new cc recipient ¬
        at end of cc recipients ¬
        with properties {address:"[email protected]"}
    make new cc recipient ¬
        at end of cc recipients ¬
        with properties {address:"[email protected]"}
    
    end tell
    end tell
Sign up to request clarification or add additional context in comments.

2 Comments

To reduce the code duplication, you could also repeat through a list of the addresses.
Ah, cool. Appreciate it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.