Last semester, our dorm room got docked points quite often, mainly because I was the one doing most of the cleaning, and I didn’t like going back to the dorm at noon. So I came up with a solution to remind myself to go back to the dorm every day at noon. I saw a Sina App Engine-based email notification feature on Cui Kai’s site, and figured I could tinker with it a bit — with a few modifications, it would meet my needs perfectly.
Here are the specific steps:
-
Write a
fnms.phpscript that sends an email to a 139 mailbox, with SMS notification enabled in the 139 mailbox settings -
Deploy a cron job on Sina SAE to execute fnms.php on a schedule
-
The fnms.php can be written like this:
$mail = new SaeMail();
$ret = $mail->quickSend( 'recipient@139.com' , 'Hey, time is up' , 'Go back to the dorm and clean up! Poor Zhou Liang' , 'sender@sina.cn' , 'password' , 'smtp.sina.cn' , 25 ); // specify SMTP and port
//Output error code and message on failure
if ($ret === false)
var_dump($mail->errno(), $mail->errmsg());
[/cce_php]
The cron configuration is as follows:
[cce_php]
cron:
- description: Dorm cleaning
url: fnms.php
schedule: every Sunday of month 12.00
timezone: jiaxing
This scheduled email and SMS reminder feature based on Sina SAE can also be used for things like scheduled email sending, birthday wishes, timed memo reminders, and more. Feel free to tinker with it if you’re interested.
The biggest advantage is that it’s currently free and doesn’t consume your own server resources.