Hi,
To send message using apple script, I am currently using the below script on Leopard
Here, I will have to specifically copy the message to Send mailbox before moving it to outbox for delivery. This also results in keeping the mail in the local sent items folder and not on the email server. Also, it will sometime result in incomplete save.
Is there a better workaround for making the mail appear in the sent items during delivery ?
Also, is there a better workaround instead of enabling/disabling the account for message delivery ?
tell application "Mail" set theAccount to accounts set theMailbox to mailbox "Drafts" of account theAccount set theMessageList to messages of theMailbox
repeat with eachMessage in theMessageList
// Here, I will get the reference to the EMLX file and modify the contents before
// sending the mail.
set read status of eachMessage to true copy eachMessage to mailbox "Sent" of theAccount delay 0 move eachMessage to mailbox "Outbox" end repeat
tell theAccount if enabled then set enabled to false delay 1 set enabled to true end if end tell
end tell
Thanks, Deepak |