Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- /usr/bin/osascript > /dev/null <<ASCPT
- set stdinText to "$(cat | sed -e 's/\\/\\\\/g' -e 's/\"/\\\"/g')"
- set recipientName to "John Doe"
- set recipientAddress to "nobody@nowhere.com"
- set theSubject to "Email from standard input"
- set theContent to "This email was created and sent using AppleScript!"
- tell application "Mail"
- set theMessage to make new outgoing message with properties {subject:theSubject, content:stdinText, visible:true}
- tell theMessage
- make new to recipient with properties {name:recipientName, address:recipientAddress}
- send
- end tell
- end tell
- ASCPT
Add Comment
Please, Sign In to add comment