Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Import smtplib for the actual sending function
- import smtplib
- # Import the email modules we'll need
- from email.mime.text import MIMEText
- msg = MIMEText("TEST FILE")
- me = 'me@gmail.com'
- you = me
- msg['Subject'] = 'This is a test'
- msg['From'] = me
- msg['To'] = you
- #username and password here
- username = 'username'
- password = 'password'
- # Send the message via gmail with ssl
- s = smtplib.SMTP_SSL('smtp.gmail.com:465')
- s.login(username,password)
- s.send_message(msg)
- s.quit()
- Traceback (most recent call last):
- File "F:DesktopemailTest.py", line 24, in <module>
- s.login(username,password)
- File "F:Python34libsmtplib.py", line 652, in login
- raise SMTPAuthenticationError(code, resp)
- 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