JBHF commited on
Commit
71d8cca
·
verified ·
1 Parent(s): 03840a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -12,6 +12,8 @@
12
 
13
  # ZIE OOK:
14
  # https://realpython.com/python-send-email/#adding-attachments-using-the-email-package
 
 
15
 
16
  """
17
  If you've two-step verification enabled, your regular password won't work. Instead, generate an app-specific password:
@@ -51,7 +53,10 @@ def send_email(subject, body, sender, recipients, password):
51
  msg['From'] = sender
52
  msg['To'] = ', '.join(recipients)
53
 
54
- with smtplib.SMTP_SSL('smtp.gmail.com', 465) as smtp_server:
 
 
 
55
  smtp_server.login(sender, password)
56
  smtp_server.sendmail(sender, recipients, msg.as_string())
57
 
 
12
 
13
  # ZIE OOK:
14
  # https://realpython.com/python-send-email/#adding-attachments-using-the-email-package
15
+ #
16
+ # https://www.saleshandy.com/smtp/gmail-smtp-settings/
17
 
18
  """
19
  If you've two-step verification enabled, your regular password won't work. Instead, generate an app-specific password:
 
53
  msg['From'] = sender
54
  msg['To'] = ', '.join(recipients)
55
 
56
+ # with smtplib.SMTP_SSL('smtp.gmail.com', 465) as smtp_server:
57
+ with smtplib.SMTP_SSL('smtp.gmail.com', 587) as smtp_server:
58
+ # with smtplib.SMTP_SSL('smtp.gmail.com', 25) as smtp_server:
59
+
60
  smtp_server.login(sender, password)
61
  smtp_server.sendmail(sender, recipients, msg.as_string())
62