Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Piotr Gawron
mail-sender
Commits
90cd7538
Commit
90cd7538
authored
Sep 30, 2021
by
Piotr Gawron
Browse files
introduce 100ms delay
parent
51abae98
Changes
1
Hide whitespace changes
Inline
Side-by-side
send.py
View file @
90cd7538
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment