Advertisement
Guest User

Untitled

a guest
Jan 16th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. # Import smtplib for the actual sending function
  2. import smtplib
  3.  
  4. # Import the email modules we'll need
  5. from email.mime.text import MIMEText
  6.  
  7. msg = MIMEText("TEST FILE")
  8.  
  9. me = 'me@gmail.com'
  10. you = me
  11.  
  12. msg['Subject'] = 'This is a test'
  13. msg['From'] = me
  14. msg['To'] = you
  15.  
  16. #username and password here
  17. username = 'username'
  18. password = 'password'
  19.  
  20.  
  21. # Send the message via gmail with ssl
  22. s = smtplib.SMTP_SSL('smtp.gmail.com:465')
  23. s.login(username,password)
  24. s.send_message(msg)
  25. s.quit()
  26.  
  27. Traceback (most recent call last):
  28. File "F:DesktopemailTest.py", line 24, in <module>
  29. s.login(username,password)
  30. File "F:Python34libsmtplib.py", line 652, in login
  31. raise SMTPAuthenticationError(code, resp)
  32. smtplib.SMTPAuthenticationError: (534, b'5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbsJyn5.7.14 DZytmH_1-mwcm6vOSQ8erg0EXRR-OzQ6-shmU4noqJdeRPdzO62-ZIC2GPMtLNj3u5-qxJn5.7.14 ZT3QrgTcO7d5zpJ8UtO2vvTFU1G2rmMWfBwpvavpD8__GaVCWHWszps1GzZqxnxJbqD1DAn5.7.14 EX-9IS6nxe9-giAhaFj5FryML1r0Qr1wcUH9tEmRdjX4KlO1xX4BhPBMJ5GJ7imrzrLZUvn5.7.14 NgG0BaLrwWzUK1SSd_bqptGe15rg> Please log in via your web browser andn5.7.14 then try again.n5.7.14 Learn more atn5.7.14 https://support.google.com/mail/answer/78754 uo9sm14972088wjc.49 - gsmtp')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement