Last active
February 3, 2020 07:45
-
-
Save Nick3523/b50cd2aef23fbad95d1beec69ed1ad71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yagmail | |
import random | |
from datetime import datetime | |
yag = yagmail.SMTP("email_envoyeur@gmail.com","mot_de_passe") | |
quote = "" | |
date = datetime.today().strftime('%d-%m-%Y') | |
with open("citations.txt", encoding = "ISO-8859-1") as file: | |
s = file.readlines() | |
quote = random.choice(s) | |
yag.send('email_destinataire@gmail.com', 'Citation du jour '+date, quote) | |
##Pour pouvoir lancer le script de manière quotidienne, j'utilise mon raspberry pi avec crontab## | |
##0 7 * * * /usr/bin/python3 /home/pi/QuoteSender/quoteSender.py <=> chaque jour à 7h pile, le programme est exécuté automatiquement ## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment