PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, November 8, 2022

[FIXED] What does this error message mean in Python?

 November 08, 2022     email, gmail, python, python-3.x, smtplib     No comments   

Issue

I made an email spam bot a while ago for fun. (Just as a test and to mess with friends) I tried to run it today and it wouldn't work. Any ideas why and how to fix? I've made sure that this API has access to my email.

Edit: Error Message is Traceback (most recent call last): File "C:\Users\user\OneDrive\Desktop\Code\Spam Bot.py", line 10, in server.login('email', 'password') File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 750, in login raise last_exception File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 739, in login (code, resp) = self.auth( File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\smtplib.py", line 662, in auth raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials r185-20020acadac2000000b0035173c2fddasm754089oig.51 - gsmtp')


e = 0

server = smtplib.SMTP('smtp.gmail.com', 587)

server.starttls()

server.login('email', 'password')
while(e < 2):
    server.sendmail('email',
                'receiver',
                'text'
                )
    e = e + 1
    print("DONE")```

Solution

Username and Password not accepted.

Do to the removal of less secure apps you can not use the gmail users actual password when connecting to the smtp server.

You must either enable 2fa on the account and configure an apps password, or switch to using Xoauth2.



Answered By - DaImTo
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing