Commit 90cd7538 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

introduce 100ms delay

parent 51abae98
......@@ -5,12 +5,13 @@ import os
import smtplib
import sys
import traceback
from time import sleep
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from config import FROM, RECIPIENTS, SUBJECT, TXT_TEMPLATE, LOGIN, PASSWORD, HOST, PORT, SSL, TLS, HTML_TEMPLATE, ENCODING, REPLY_TO
logging.basicConfig()
logging.basicConfig(format='%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
logging.getLogger().setLevel(logging.INFO)
logger = logging.getLogger(__name__)
......@@ -85,6 +86,7 @@ with open(RECIPIENTS) as csv_file:
FROM, [recipient, FROM], message.as_string()
)
logger.info("Mail sent successfully to: " + recipient)
sleep(0.1)
except:
traceback.print_exc(file=sys.stdout)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment