Skip to content

Commit

Permalink
Add delay before sending each user
Browse files Browse the repository at this point in the history
  • Loading branch information
junglesub authored Feb 21, 2024
1 parent 0901563 commit 9879bf7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sendmail.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import smtplib, ssl
import time
# from premailer import transform
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
Expand Down Expand Up @@ -53,6 +54,7 @@ def send_email(smtp, to_user, html):
smtp.login(os.getenv("SMTP_ID"), os.getenv("SMTP_PW")) # 아이디 비밀번호로 로그인
for user in mailing_list:
send_email(smtp, user, html)
time.sleep(1)

# smtp = smtplib.SMTP('localhost')
# smtp.sendmail("test@example.com", "junglesubmarine@gmail.com", msg.as_string())

0 comments on commit 9879bf7

Please sign in to comment.