Skip to content Skip to sidebar Skip to footer

Using Python's Smtplib, How Can I Send An Email In The Future?

I have some sample Python code from here https://docs.python.org/2/library/email-examples.html where I can successfully send emails. # Import smtplib for the actual sending functio

Solution 1:

If you are on linux you can use cron job.

Smtplib is just a library and the email is sent by the provider you specify. If you can find an email provider that supports sending delayed messages then it's possible

If you can you can run the script and use time.sleep(2 * 24 * 60 * 60) But it means that the script must run for the 2 days

Solution 2:

Most likely not.

Even if you do this, replacing 5 with the correct number:

import time
time.sleep(5) # delays for 5 seconds

The Python program will need to be running for the entire time

Post a Comment for "Using Python's Smtplib, How Can I Send An Email In The Future?"