Guest User

Untitled

a guest
Jan 22nd, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. /usr/bin/osascript > /dev/null <<ASCPT
  4. set stdinText to "$(cat | sed -e 's/\\/\\\\/g' -e 's/\"/\\\"/g')"
  5. set recipientName to "John Doe"
  6. set recipientAddress to "nobody@nowhere.com"
  7. set theSubject to "Email from standard input"
  8. set theContent to "This email was created and sent using AppleScript!"
  9.  
  10. tell application "Mail"
  11.  
  12. set theMessage to make new outgoing message with properties {subject:theSubject, content:stdinText, visible:true}
  13.  
  14. tell theMessage
  15. make new to recipient with properties {name:recipientName, address:recipientAddress}
  16. send
  17. end tell
  18. end tell
  19. ASCPT
Add Comment
Please, Sign In to add comment