Skip to content

Instantly share code, notes, and snippets.

@Nick3523 Nick3523/quoteSender.py
Last active Feb 3, 2020

Embed
What would you like to do?
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
You can’t perform that action at this time.