Skip to content

Instantly share code, notes, and snippets.

@crosson
crosson / delay_mail.rb
Last active December 10, 2015 17:48 — forked from anonymous/delay_mail.rb
This was a script I wrote to send delayed emails from macmail. The script is run in a cron every 15 minutes The script checks for items in the Mail draft folder that have a [SEND@XYZ] tag. For example, [SEND@16:00] The script checks if a drafted emails SEND@ tag matches or is near the current time. If so a new email is drafted, See step 4. The n…
#!/usr/local/bin/macruby
framework 'ScriptingBridge'
ACCOUNT = "AccountName"
DAY = Time.now.day
MONTH = Time.now.month
YEAR = Time.now.year
CURRENT_TIME = ((Time.now - 150)..(Time.now + 300))