tell application "Finder"
set theFile to ":Users:yueyansheng:Desktop:sadasd.pptx" as alias
set fileName to name of theFile
end tell
set theSubject to fileName
set theBody to "Hello sir. Here is my " & fileName
set theAddress to "Some Email"
set theAttachment to theFile
set theSender to "Some Sender"
tell application "Mail"
set theNewMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return, visible:true}
tell theNewMessage
set visibile to true
set sender to theSender
make new to recipient at end of to recipients with properties {address:theAddress}
try
make new attachment with properties {file name:theAttachment} at after the last word of the last paragraph
set message_attachment to 0
log "message_attachment = " & message_attachment
on error
set message_attachment to 1
end try
#tell content
# make new attachment with properties {file name:theAttachment, path:fileList}
#end tell
#send
end tell
activate
end tell
AppleScript发送邮件
最新推荐文章于 2024-08-30 09:41:22 发布