Ask coding questions

← Back to all posts
Google not helping :(
isaiah08 (63)

I get an error, then get an email saying google has blocked it. How can i turn this off? Thanks!

Comments
hotnewtop
mrshaw (9)

I'm not sure why you call .ehlo twice. But ignoring that, there seems to be a simpler way to create an SSL connection to GMail using the following method:

Source: https://stackabuse.com/how-to-send-emails-with-gmail-using-python/

Give that a go and see if you have anymore luck!

Coder100 (17122)

Have you turned on allow unsafe applications?
click here to learn how to turn it on

isaiah08 (63)

I did, but i'm still getting this error:
Traceback (most recent call last):
File "main.py", line 18, in <module>
server.login(sender_email, password)
File "/usr/lib/python3.8/smtplib.py", line 734, in login
raise last_exception
File "/usr/lib/python3.8/smtplib.py", line 723, in login
(code, resp) = self.auth(
File "/usr/lib/python3.8/smtplib.py", line 646, 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 l6sm298046ilq.61 - gsmtp')

@Coder100

mil510774 (0)

@isaiah08 I'm having the same issue if you could explain how to fix the problem please let me know.

Coder100 (17122)

Are those even valid emails? @isaiah08

isaiah08 (63)

I had them valid but changed them as to not give away my email. @Coder100

isaiah08 (63)

I have no idea how to fix it, but you probably should not do it on repl.it if you are not a hacker because someone could come in and steal you email and password. @mil510774

Coder100 (17122)

use a .env file smh smh @isaiah08