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

Click here to return to the 'Generate 'Read Receipts' in' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Generate 'Read Receipts' in
Authored by: serko92 on Aug 26, '05 01:36:35PM
Here is a version of the script that will invisibly send the return receipt message, just like Outlook or any other app
with that capability would, without you having to click "Send":

using terms from application "Mail"
	on perform mail action with messages selectedMsgs
		repeat with msg in selectedMsgs
			set theSubject to subject of msg
			set theSender to extract name from sender of msg
			set theAddress to extract address from sender of msg
			set theDate to date sent of msg
			tell application "Mail"
				set nowDate to current date
				set theBody to "Your message" & return & return & "    Re: " & theSubject & return & "       Sent: " & theDate & return & return & "was received" & nowDate & ". You WILL NOT get a second confirmation when the message is actually read.  Thank you." & return
				set newMessage to make new outgoing message with properties {subject:"Return Receipt: " & theSubject, content:theBody & return & return}
				tell newMessage
					make new to recipient at end of to recipients with properties {name:theSender, address:theAddress}
				end tell
				send newMessage
			end tell
		end repeat
	end perform mail action with messages
end using terms from

Also I want to point out that if you send an email to yourself, the Mail Rule mentioned in the article will send a receipt to yourself,
and then a receipt of that receipt, and another, and so on. Every receipt generated contains the same header that triggers the receipt Rule,
so the cycle never ends. Therefore the Rule should be changed to:
  • Description: Read Receipt Requested
  • if (all) of the following conditions are met:
    • (Disposition-Notification-To) (contains) (@)
    • (Subject) (does not contain) (Return Receipt)
  • Perform the following actions:
    • (Run AppleScript) (~/Library/Scripts/Mail Scripts/Return Receipt.scpt)
Other than that - the best solution I have come across, while searching for a way to do this.

[ Reply to This | # ]