Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Forwarding Mail Script Problem' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Forwarding Mail Script Problem
Authored by: brython on Feb 18, '05 04:58:33PM
Thanks for the great script! I'm actually looking for a way to forward my email to Earthlink's junkmail people (junkmail@earthlink.net). In order to do this, since it appeared that this script was pretty much what I was looking for, I just changed every instance of "Redirect" in the names of items to "Forward" (just for clarity), and got the following:
using terms from application "Mail"
	on perform mail action with messages selectedMessages
		set AppleScript's text item delimiters to ""
		set theForwardRecipient to "junkmail@earthlink.net"
		set theForwardSender to "myemail@earthlink.net"
		repeat with eachMessage in selectedMessages
			tell application "Mail"
				set theForwardedEmail to forward eachMessage ¬
					with opening window
				tell theForwardedEmail
					make new to recipient at beginning of to recipients ¬
						with properties {address:theForwardRecipient}
				end tell
				set the sender of theForwardedEmail to theForwardSender
				send theForwardedEmail
			end tell
		end repeat
	end perform mail action with messages
end using terms from
The problem is that somehow, the forwarded emails are being sent to ' '. Why is this happening? Am I missing something obvious here? (It's entirely possible, since I'm very new to AppleScript.) I appreciate any help! Greg

[ Reply to This | # ]