Mail Weekend Reponse

jakesaunders27

macrumors 6502a
Original poster
Jan 23, 2012
896
5
United Kingdom
Hi,
Does anyone know how to automatically respond to any email that comes in at weekends, its for my business so it can say our hours are monday - friday etc.

Thanks
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
29,398
8,985
California
Hi,
Does anyone know how to automatically respond to any email that comes in at weekends, its for my business so it can say our hours are monday - friday etc.

Thanks
Is this an iCloud email account?

You can login to iCloud.com then in Mail click the little cog at the bottom left and you get this screen where you can setup a "vacation message" that would do what you want. You would need to login to iCloud.com every Friday evening an manually turn this on then turn it off Monday AM.

 

jakesaunders27

macrumors 6502a
Original poster
Jan 23, 2012
896
5
United Kingdom
Is this an iCloud email account?

You can login to iCloud.com then in Mail click the little cog at the bottom left and you get this screen where you can setup a "vacation message" that would do what you want. You would need to login to iCloud.com every Friday evening an manually turn this on then turn it off Monday AM.

No its a domain email address, thanks anyway
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
29,398
8,985
California
No its a domain email address, thanks anyway
Is it IMAP and are you using OS X Mail app to read mail.

You could just leave a computer on with Mail running and setup a rule like this.



If you click that reply message text button this pops up where you just enter what you want to say.



You can find rules in Mail preferences.

Ideally, this is something you would want running on your mail server, but if you do not have that ability this rule will work for you.

You would have to enable/disable each weekend.
 

jakesaunders27

macrumors 6502a
Original poster
Jan 23, 2012
896
5
United Kingdom
Is it IMAP and are you using OS X Mail app to read mail.

You could just leave a computer on with Mail running and setup a rule like this.

Image

If you click that reply message text button this pops up where you just enter what you want to say.

Image

You can find rules in Mail preferences.

Ideally, this is something you would want running on your mail server, but if you do not have that ability this rule will work for you.

You would have to enable/disable each weekend.
Wow that's perfect, thanks for that!
 

kryten2

macrumors 6502a
Mar 17, 2012
996
59
Belgium
Or a rule that runs an Applescript with something like this :

Code:
-- Assuming working hours from 9 to 5
-- time of (current date) will return the number of seconds elapsed since 12:00:00 AM that morning.

------------Mail rule Script----------------------------------------------
using terms from application "Mail"
	on perform mail action with messages theMessages
		if weekday of (current date) is in {Saturday, Sunday} or time of (current date) < 32400 or time of (current date) > 61200 then
			tell application "Mail"
				repeat with theMessage in theMessages
					set theSubject to subject of theMessage
					set theContent to "Our opening hours are monday - friday from 9 to 5."
					set theSender to sender of theMessage
					set newMessage to make new outgoing message with properties {visible:false, subject:theSubject, content:theContent}
					tell newMessage
						make new to recipient at end of to recipients with properties {address:theSender}
					end tell
					send newMessage
				end repeat
			end tell
		end if
	end perform mail action with messages
end using terms from

------------------Mail rule Script Ends here------------------------------
(*
Next block is for running the script in Script Editor with some mail messages selected in the Mail applictation. If everything works remove the entire block and attach script to rule.
*)
-----------------ONLY NEEDED FOR TESTING FROM WITHIN SCRIPT EDITOR--------
tell application "Mail"
	set myMessages to selection
	tell me to perform mail action with messages myMessages
end tell
-----------------REMOVE WHEN TESTING IS DONE !!!!!!-----------------------
Note : No need to enable/disable each weekend. It will only reply during weekends and weekdays from 5 o'clock untill 9 o'clock. If you only want the weekend then delete or time of (current date) < 32400 or time of (current date) > 61200 from the script. Not thoroughly tested but it should work.
 
Last edited:

jakesaunders27

macrumors 6502a
Original poster
Jan 23, 2012
896
5
United Kingdom
Or a rule that runs an Applescript with something like this :

Code:
-- Assuming working hours from 9 to 5
-- time of (current date) will return the number of seconds elapsed since 12:00:00 AM that morning.

------------Mail rule Script----------------------------------------------
using terms from application "Mail"
	on perform mail action with messages theMessages
		if weekday of (current date) is in {Saturday, Sunday} or time of (current date) < 32400 or time of (current date) > 61200 then
			tell application "Mail"
				repeat with theMessage in theMessages
					set theSubject to subject of theMessage
					set theContent to "Our opening hours are monday - friday from 9 to 5."
					set theSender to sender of theMessage
					set newMessage to make new outgoing message with properties {visible:false, subject:theSubject, content:theContent}
					tell newMessage
						make new to recipient at end of to recipients with properties {address:theSender}
					end tell
					send newMessage
				end repeat
			end tell
		end if
	end perform mail action with messages
end using terms from

------------------Mail rule Script Ends here------------------------------
(*
Next block is for running the script in Script Editor with some mail messages selected in the Mail applictation. If everything works remove the entire block and attach script to rule.
*)
-----------------ONLY NEEDED FOR TESTING FROM WITHIN SCRIPT EDITOR--------
tell application "Mail"
	set myMessages to selection
	tell me to perform mail action with messages myMessages
end tell
-----------------REMOVE WHEN TESTING IS DONE !!!!!!-----------------------
Note : No need to enable/disable each weekend. It will only reply during weekends and weekdays from 5 o'clock untill 9 o'clock. If you only want the weekend then delete or time of (current date) < 32400 or time of (current date) > 61200 from the script. Not thoroughly tested but it should work.
Wow thanks! I never thought about AppleScript! Cheers!