Adding Hyperlinked Image Attachment To an E-mail
tell application "Mail"
set thePath to choose file
tell application "System Events"
set theAttachment to path of thePath
end tell
set theSender to "name@damain.com"
-- In the unedited script, the content would be entered via dialog boxes.
set theSubject to "Testing: 1, 2, 3…"
set theBody to "This is a test."
-- In the unedited script, the recipient information would be retrieved from a txt file.
set emailAddress to "recipient@domain.com"
set emailName to "John Smith"
set theContent to emailName & "," & return & return & theBody & return & return
set theMessage to makenewoutgoing messagewith properties {subject:theSubject, content:theContent, visible:true}
set sender of theMessage to theSender
tell theMessage
makenewto recipientat end of every to recipientwith properties {address:emailAddress}
makenewattachmentwith properties {file name:theAttachment as alias}
end tell
--send theMessage
end tell