-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmail.py
34 lines (30 loc) · 923 Bytes
/
mail.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
import yagmail
# Create the yagmail client
yag = yagmail.SMTP(
user='[email protected]',
password=os.getenv("PASSWORD")
)
def notify_block(mail, name):
contents = f'''
<html>
<body>
<h1>{name},</h1>
<p>
Por seguridad, hemos bloqueado su cuenta debido a múltiples intentos fallidos de inicio de sesión.
Para desbloquear su cuenta, por favor contacte con el administrador respondiendo a este correo.
</p>
<p>
Atentamente,<br>
El equipo de Soporte
</p>
</body>
</html>
'''
yag.send(
to=mail,
subject='Bloqueo de Cuenta',
contents=contents,
headers={'From': 'Academia USAC <[email protected]>'}
)
notify_block('[email protected]', "José Estuardo González Sarceño")