| 1 |
(* |
| 2 |
https://code.tutsplus.com/the-ultimate-beginners-guide-to-applescript--mac-3436t |
| 3 |
*) |
| 4 |
-- Variables |
| 5 |
set recipientName to "John Doe" |
| 6 |
set recipientAddress to "[email protected]" |
| 7 |
set theSubject to "AppleScript Automated Email" |
| 8 |
set theContent to "This email was created and sent using AppleScript!" |
| 9 |
|
| 10 |
--Mail Tell Block |
| 11 |
tell application "Mail" |
| 12 |
|
| 13 |
--Create the message |
| 14 |
set theMessage to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true} |
| 15 |
|
| 16 |
--Set a recipient |
| 17 |
tell theMessage |
| 18 |
make new to recipient with properties {name:recipientName, address:recipientAddress} |
| 19 |
|
| 20 |
--Send the Message |
| 21 |
send |
| 22 |
|
| 23 |
end tell |
| 24 |
end tell |