I\'m writing an application and I\'d like it to somehow schedule an email to be sent at a later date (likely an hour after it is run). The programming language will be Python or
Answer 1:
In Python, use threading.Timer
to schedule in the future; use smtplib
to send an email. No external library needed.
Answer 2:
Sounds like you want the sending program to quit rather than having it wait in the background. You may use cron for this. Alternative just use the unix command sleep
and mail
:
$ { sleep 3600; echo "hello world" | mail -s the-subject destination-email; } &
P.S. I don't believe SMTP have anything for you in this case. You are really looking for an MTA that has scheduling feature. Though I'm not familiar with it to make a recommendation.