
set theSubject to "new subject"
set theBody to "this is the message body"
set theSender to "Simon"
set theName to ""
set theAddress to "receiver email address"
set theAttachment to "Macintosh HD:Users:Desktop:raina.jpg" as alias
tell application "Mail"
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
tell newMessage
set visible to true
set sender to theSender
make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
tell content
make new attachment with properties {file name:theAttachment} at after the last paragraph
end tell
end tell
activate
end tell
No comments:
Post a Comment