|
|
An AppleScript to batch-redirect email in Mail.app
I was also in the need for uploading about 175,000 emails into Gmail (upgraded to 80GB plan ;) The scripts above no longer worked in Lion, so I mashed together a couple of scripts to get what I have been successfully using below. I also added a utility to automatically add a set subject text for empty subject emails, else they would be waiting for user response to confirm sending emails with an empty title (annoying). One thing also to be aware of is that you need a decent SMTP server for sending all these emails to Gmail with. Most providers, even MobileMe, have daily/hourly send limits, which are too small to be usable for such Gmail migration purposes. I used an email account hosted on some MediaTemple, (dv) plan, web hosting, which has no daily send limits. This was the final key for me to get this all to work. Any questions, please feel free to contact me. OK, here is the code:
tell application "Mail"
set AppleScript's text item delimiters to ""
set theRedirectRecipient to "YOURGMAILADDRESSHERE@gmail.com"
set theRedirectSender to "YOUR NAME HERE "
set theMessages to the selection
repeat with thisMessage in theMessages
tell application "Mail"
set theRedirectedEmail to redirect thisMessage with opening window
tell theRedirectedEmail
if subject of thisMessage is "" then
set subject of theRedirectedEmail to "WAS EMPTY SUBJECT"
end if
make new to recipient at beginning of to recipients with properties {address:theRedirectRecipient}
delete bcc recipients
delete cc recipients
end tell
set the sender of theRedirectedEmail to theRedirectSender
#delay 1
send theRedirectedEmail
end tell
end repeat
end tell
An AppleScript to batch-redirect email in Mail.app
Hello everybody
Thanks for the tips regarding the forwarding/redirecting of emails. I'm trying to forward specific incoming emails to my Evernote account. But before I forward the message, I wanted to add the date of the email and the desired Evernote-Notebook and Evernote-Tags to the subject. These added parameters are based on the name of the Mail rule.
Example:
The new subject of the forwarded email will be:
In Evernote the message title will look like this:
This is the subject [07.01.2012]
I used the code listed below and most of it works fine, but I have a strange issue. Does anyone have any clue why I get this behavior?
Thank you ver much. PS: My Mac runs OSX Lion 10.7.2.
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.24 seconds |
|