Skip to content

Instantly share code, notes, and snippets.

@Nick3523 Nick3523/
Last active Feb 3, 2020

What would you like to do?
import yagmail
import random
from datetime import datetime
yag = yagmail.SMTP("","mot_de_passe")
quote = ""
date ='%d-%m-%Y')
with open("citations.txt", encoding = "ISO-8859-1") as file:
s = file.readlines()
quote = random.choice(s)
yag.send('', '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/ <=> 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.