Skip to content

Commit

Permalink
PyRece: soporte para SMTP Start TLS
Browse files Browse the repository at this point in the history
  • Loading branch information
reingart committed Apr 17, 2018
1 parent 6743e15 commit 2ea6f9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyrece.py
Expand Up @@ -15,7 +15,7 @@
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2009-2017 Mariano Reingart"
__license__ = "GPL 3.0"
__version__ = "1.31a"
__version__ = "1.31b"

from datetime import datetime
from decimal import Decimal, getcontext, ROUND_DOWN
Expand Down Expand Up @@ -1005,6 +1005,10 @@ def enviar_mail(self, item, archivo):
self.smtp = SMTP(conf_mail['servidor'], conf_mail.get('puerto', 25))
if conf_mail['usuario'] and conf_mail['clave']:
self.smtp.ehlo()
if conf_mail.get('tls', False):
self.log("Iniciando TLS...")
self.smtp.starttls()
self.smtp.ehlo()
self.smtp.login(conf_mail['usuario'], conf_mail['clave'])
to = [msg['To']]
bcc = conf_mail.get('bcc', None)
Expand Down

0 comments on commit 2ea6f9c

Please sign in to comment.