New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMTPSenderRefused: (530, '5.5.1 Authentication Required. Learn more at\n5.5.1 https://support.google.com/m ail/answer/14257 h66sm6105022pfe.6 - gsmtp', u'Flasky Admin #167
Comments
Well, the error seems pretty clear to me:
Are you providing credentials to your email server? If you are, are they correct? |
Here is my Configuration class Config: Here I edited email and password in original. |
You need to set the username and password in environment variables. Read about |
it worked! Thanks a lot I changed it like..
|
Sir, Thanks |
Permissions are not assigned directly to users. Users are assigned a "role", and the role contains the list of things that are allowed (the "permissions"). If you want to assign a role to a user, just assign it to it and save it:
|
As I explained above, the user needs to be the correct role assigned so that it is allowed to post. Without that role assignment the application will not display the post form. What role is assigned to user |
Sir, |
What do you mean when you say you cannot assign a role? I showed you above how to assign a role. Can you show me how you did it? |
'spaceled' is my user |
Why are you inserting your code in the |
You need to compare the |
Sir, |
Yes. |
Yes. I think you need to learn about classes and objects, you are missing some very important concepts in the Python language. You are trying to set the role on a string, not on a user object. |
Thanks Sir |
Sir, I am facing an authentication problem with my flask app. The config code is written below app.config['MAIL_SERVER'] = 'smtp.gmail.com'
app.config['MAIL_PORT'] = 465
app.config['MAIL_USE_TLS'] = False
app.config['MAIL_USE_SSL'] = True
app.config['MAIL_USERNAME'] = os.environ.get('username')
app.config['MAIL_PASSWORD'] = os.environ.get('password')` Further, I am calling the data from MySQL to compare it with today's date. The code is written below. I have commented the for loop as of now just debug the config error. @app.route('/mailing', methods=['GET', 'POST'])
@is_logged_in
def mailing():
#Create cursor
cur = mysql.connection.cursor()
#Get Tasks
result = cur.execute("SELECT * FROM grades WHERE remind_date=%s", [now.strftime('%Y-%m-%d')])
grades = cur.fetchone()
# if str(grades['remind_date']) == now.strftime('%Y-%m-%d'):
msg = Message('Good Morning', sender='jpisvideotest@gmail.com', recipients=['hbagla@jpischool.com'])
mail.send(msg)
# Close connection
cur.close()
return redirect(url_for('dashboard')) |
I have also allowed my Gmail account to support access of less secure apps |
@HarshitBagla What's the error? The only thing I can see is that you are not setting the body of the email. |
hello @miguelgrinberg i am facing email verification problem of laravel . |
Laravel? Are you sure you are asking in the right place? In any case, the error message sends you to a link where you can find what the problem is (it's a security feature from Gmail that you'll need to turn off). |
thanks
…On Wed, Dec 20, 2017 at 1:10 PM, Miguel Grinberg ***@***.***> wrote:
Laravel? Are you sure you are asking in the right place? In any case, the
error message sends you to a link where you can find what the problem is
(it's a security feature from Gmail that you'll need to turn off).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#167 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AByMW_t7BlPZa5_YAK8dC6zO9_U9j4W6ks5tCLLwgaJpZM4JFTqz>
.
--
Mirbahar Nurul Amin
Sr. Web Developer
Mobile No:+8801917147677
Kawran Bazar,Dhaka
|
hi sir I am facing this problem on my flask app . i want to reset the password of the user by sending a notification to gmail smtplib.SMTPSenderRefused: (530, b'5.5.1 Authentication Required. Learn more at\n5.5.1 https://support.google.com/mail/?p=WantAuthError o72-v6sm16878534pfk.76 - gsmtp', 'onicsbantu@gmail.com') import os app = Flask(name) from flaskblog import routes |
Google mail requires authentication, it seems you are not passing username and password, or they are incorrect. |
Not sure if this will help but make sure to use a application password
inside Google. Seen as app password or 3rd party access to your Google
account. Google has non interactive passwords for this and they work with
2fa as well.
Using your login gmail password will throw errors.
Cheers,
Jeromie Kirchoff (JayRizzo)
…On Mon, Aug 6, 2018, 3:37 AM Miguel Grinberg ***@***.***> wrote:
Google mail requires authentication, it seems you are not passing username
and password, or they are incorrect.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#167 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AVzXbo3EpTaNYdg_0nMj2iITi701pvf-ks5uOBxjgaJpZM4JFTqz>
.
|
hello, @miguelgrinberg I am facing email verification problem of sending mail. EMAIL_HOST='smtp.gmail.com' plz solve this problem |
@gyandjango You have to provide a valid password for the account, google requires authentication to send email. |
Sir put valid gmail password but not send msg in gmail |
I can't really help you. The error message from gmail indicates you are not providing valid credentials. Review the URL they include in the error for more information. |
Sir how to create otp in django plz help me to store database
…On Fri 14 Sep, 2018, 5:54 PM Miguel Grinberg, ***@***.***> wrote:
I can't really help you. The error message from gmail indicates you are
not providing valid credentials. Review the URL they include in the error
for more information.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#167 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AlRyqukDhKl6ZqQU3izlHiZnfF4VBWXkks5ua5_-gaJpZM4JFTqz>
.
|
Sir plz tail me to provide valid credentials |
Hello,miguelgrinberg .
|
Request Method: | POST |
---|---|
http://127.0.0.1:8000/password-reset/ | |
2.1.3 | |
SMTPSenderRefused | |
(530, b'5.5.1 Authentication Required. Learn more at\n5.5.1 https://support.google.com/mail/?p=WantAuthError p2sm3089174pfp.125 - gsmtp', 'webmaster@localhost') | |
c:\users\mickey\appdata\local\programs\python\python37\Lib\smtplib.py in sendmail, line 867 | |
F:\webwork\Django\Test\MyEnv\Scripts\python.exe | |
3.7.1 | |
['F:\webwork\Django\madhatterlast', 'F:\webwork\Django\Test\MyEnv\Scripts\python37.zip', 'F:\webwork\Django\Test\MyEnv\DLLs', 'F:\webwork\Django\Test\MyEnv\lib', 'F:\webwork\Django\Test\MyEnv\Scripts', 'c:\users\mickey\appdata\local\programs\python\python37\Lib', 'c:\users\mickey\appdata\local\programs\python\python37\DLLs', 'F:\webwork\Django\Test\MyEnv', 'F:\webwork\Django\Test\MyEnv\lib\site-packages'] | |
Thu, 13 Dec 2018 15:36:06 +0000 |
Looking forward to hearing from you.
Thanks.
@mickey911112 this repo is a Flask project, you may need to ask in a Django community for specific information about your case, but in any case, the error is about not providing valid credentials for your Google account. |
Hi, this problem is solvable.
SMTPSenderRefused at /info/(530, b'5.5.1 Authentication Required. Learn more at\n5.5.1.....
and i see MAIL_USERNAME = None, MAIL_PASSWORD = None and etc.(where the hell is she? at was in 1 session cmd) brain boils.. Need create an environment variable(MAIL_USERNAME and etc) in System Properties! |
Hi all, I faced the same. Below are the steps i followed to fix it 1, I set the environment variables using the edit system environment variables option in control panel. echo %EMAIL_USER% 3, I checked whether i am fetching the proper data from inside the python vm by running the below commands in the interpreter 4, Added another check point while initializing the flask app in init.py print(f"For SMT Mail: username:{os.environ.get('EMAIL_USER')}, password:{os.environ.get('EMAIL_PASS')} ") 5, When i run the application inside terminal from visual studio code the values were not being set properly 6, When i run the same from a cmd outside vs code the environment variables were set properly and email function worked as expected. **For SMT Mail: username:***, password: Further more as @RWSmax explains when you set the environment variable in cmd it applies right there and then, to that process' environment. Also when you open a new terminal or cmd it will get a copy of the current environment from it's parent so you would have to restart the process in order to get a new set of environment variables. Its basically was about setting the environment variables properly and also wrt how you are setting the environment variables. At the end Step 4 would give you the verdict. |
Hey ! (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials c1sm3161260pfc.94 - gsmtp') |
Use the browser and login to your account. Go to settings and allow your
account to be logged in by other means. I don't exactly remember what it
says in that but it should be easy to find. If you find any difficulty
please let me know.
…On Thu, Apr 23, 2020, 12:47 PM emit077 ***@***.***> wrote:
Hey !
i got the error in the simple SMTP setup in the Django project for sending
email
but i don;t know why its not acception it
(535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8
https://support.google.com/mail/?p=BadCredentials c1sm3161260pfc.94 -
gsmtp')
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#167 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBRTQNKW2GMFCC4QF6NOADROB5LHANCNFSM4CIVHKZQ>
.
|
i got this error please help me out from this error smtplib.SMTPSenderRefused login_manager.login_message_category = 'info' please check what's wrong here.... |
@KhandelwalAayush did you set your username and password in the environment variables? The error says you are not providing authentication. |
@miguelgrinberg where i have to set user name and password in the EV and which id password, i have to provide please explain in briefly |
@KathiravanBalasubramanian this is covered in detail in the book that goes along with this repository. If you are not following the tutorial, then see the Flask-Mail documentation to learn how to set up your credentials. |
@miguelgrinberg |
@KhandelwalAayush the username and password go in environment variables, but as I said, this may not make much sense to you if you are not following the book. Read the Flask-Mail documentation if you want more general instructions on how to send email. |
@miguelgrinberg Now i set the user name and password in the E.V. and also allow the less secure app but still coming the same error.....please help **smtplib.SMTPSenderRefused Traceback (most recent call last) You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection: dump() shows all variables in the frame |
Hi,
I am developing a flask app. I am using python 3.7.8. I am working with
flask_mysqldb but as soon as I run app.py, it says "No module named
flask_mysqldb" although I have it installed on my computer. What should
I do?
…On Mon, 29 Jun 2020 at 22:57, Aayush Khandelwal ***@***.***> wrote:
@miguelgrinberg <https://github.com/miguelgrinberg> Now i set the user
name and password in the E.V. and also allow the less secure app but still
coming the same error.....please help
**smtplib.SMTPSenderRefused
smtplib.SMTPSenderRefused: (530, b'5.7.0 Authentication Required. Learn
more at\n5.7.0 https://support.google.com/mail/?p=WantAuthError
d5sm159706pjo.20 - gsmtp', ***@***.***')
Traceback (most recent call last)
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py",
line 2464, in *call*
return self.wsgi_app(environ, start_response)
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py",
line 2450, in wsgi_app
response = self.handle_exception(e)
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py",
line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask_compat.py",
line 39, in reraise
raise value
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py",
line 2447, in wsgi_app
response = self.full_dispatch_request()
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py",
line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py",
line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask_compat.py",
line 39, in reraise
raise value
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py",
line 1950, in full_dispatch_request
rv = self.dispatch_request()
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask\app.py",
line 1936, in dispatch_request
return self.view_functionsrule.endpoint <http://**req.view_args>
File "F:\Flask_Blog\flaskblog\routes.py", line 180, in reset_request
send_reset_email(user)
File "F:\Flask_Blog\flaskblog\routes.py", line 170, in send_reset_email
mail.send(msg)
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask_mail.py",
line 492, in send
message.send(connection)
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask_mail.py",
line 427, in send
connection.send(self)
File
"C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\site-packages\flask_mail.py",
line 188, in send
self.host.sendmail(sanitize_address(envelope_from or message.sender),
File "C:\Users\hp\AppData\Local\Programs\Python\Python38\Lib\smtplib.py",
line 871, in sendmail
raise SMTPSenderRefused(code, resp, from_addr)
smtplib.SMTPSenderRefused: (530, b'5.7.0 Authentication Required. Learn
more at\n5.7.0 https://support.google.com/mail/?p=WantAuthError
d5sm159706pjo.20 - gsmtp', ***@***.***')
The debugger caught an exception in your WSGI application. You can now
look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can
click on the "Traceback" headline. From the text traceback you can also
create a paste of it. For code execution mouse-over the frame you want to
debug and click on the console icon on the right side.
You can execute arbitrary Python code in the stack frames and there are
some extra helpers available for introspection:
dump() shows all variables in the *frame*
dump(obj) dumps all that's known about the object**
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#167 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFBRTQOLV4EFKS3YHN2TJFDRZDFIZANCNFSM4CIVHKZQ>
.
|
@miguelgrinberg Sir, I've correctly assigned the mail username and password in a python shell using the os.environ['PROPERTY'], also enabled 'Less secure apps' from the settings of my google account, but still I'm getting SMTPSenderRefused Error. If you could please help me.....I've gone through the above issues faced by the other users and read your replies. According to me everything is fine in my code and according to the book. |
What do you mean? You have to set environment variables in your shell. |
Thanks sir for your reply. This is what I did before trying to send mail.
I would also like to mention that up till date I was successful in
receiving ONLY one mail from my application, when I registered for the very
first time.
…On Mon, 7 Sep, 2020, 3:08 pm Miguel Grinberg, ***@***.***> wrote:
assigned the mail username and password in a python shell using the
os.environ['PROPERTY']
What do you mean? You have to set environment variables in your shell.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#167 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APHCKZPEVYO27KBEFR2LDPDSESSX5ANCNFSM4CIVHKZQ>
.
|
Ok sir got the issue resolved, thanks
On Mon, 7 Sep, 2020, 3:49 pm DIVYANSH PUROHIT, <dpurohit_be19@thapar.edu>
wrote:
… Thanks sir for your reply. This is what I did before trying to send mail.
I would also like to mention that up till date I was successful in
receiving ONLY one mail from my application, when I registered for the very
first time.
On Mon, 7 Sep, 2020, 3:08 pm Miguel Grinberg, ***@***.***>
wrote:
> assigned the mail username and password in a python shell using the
> os.environ['PROPERTY']
>
> What do you mean? You have to set environment variables in your shell.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#167 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/APHCKZPEVYO27KBEFR2LDPDSESSX5ANCNFSM4CIVHKZQ>
> .
>
|
This really really helped me. Thank you very much. spent so many hours but could not find the answer. finally got it. I have gone step by step and set the variables into environment. Closed the vs code terminal and started using in CMD. ran the command and it worked. |
whoever is reading, highly recommended to follow the steps above mentioned by @KathiravanBalasubramanian. I did the same and changed somethings and it worked.
|
def generate_confirmation_token(self, expiration=3600):
|
When I try to Register a User it shows
send: 'ehlo [10.0.2.15]\r\n'
reply: '250-smtp.gmail.com at your service, [58.97.200.89]\r\n'
reply: '250-SIZE 35882577\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH\r\n'
reply: '250-ENHANCEDSTATUSCODES\r\n'
reply: '250-PIPELINING\r\n'
reply: '250 SMTPUTF8\r\n'
reply: retcode (250); Msg: smtp.gmail.com at your service, [58.97.200.89]
SIZE 35882577
8BITMIME
AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
ENHANCEDSTATUSCODES
PIPELINING
SMTPUTF8
send: u'mail FROM:reezaul.karim@gmail.com size=1802\r\n'
reply: '530-5.5.1 Authentication Required. Learn more at\r\n'
reply: '530 5.5.1 https://support.google.com/mail/answer/14257 h66sm6105022pfe.6 - gsmtp\r\n'
reply: retcode (530); Msg: 5.5.1 Authentication Required. Learn more at
5.5.1 https://support.google.com/mail/answer/14257 h66sm6105022pfe.6 - gsmtp
send: 'rset\r\n'
reply: '250 2.1.5 Flushed h66sm6105022pfe.6 - gsmtp\r\n'
reply: retcode (250); Msg: 2.1.5 Flushed h66sm6105022pfe.6 - gsmtp
send: 'quit\r\n'
reply: '221 2.0.0 closing connection h66sm6105022pfe.6 - gsmtp\r\n'
reply: retcode (221); Msg: 2.0.0 closing connection h66sm6105022pfe.6 - gsmtp
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(_self.__args, *_self.__kwargs)
File "/vagrant/project/app/email.py", line 8, in send_async_email
mail.send(msg)
File "/usr/local/lib/python2.7/dist-packages/flask_mail.py", line 492, in send
message.send(connection)
File "/usr/local/lib/python2.7/dist-packages/flask_mail.py", line 427, in send
connection.send(self)
File "/usr/local/lib/python2.7/dist-packages/flask_mail.py", line 192, in send
message.rcpt_options)
File "/usr/lib/python2.7/smtplib.py", line 731, in sendmail
raise SMTPSenderRefused(code, resp, from_addr)
SMTPSenderRefused: (530, '5.5.1 Authentication Required. Learn more at\n5.5.1 https://support.google.com/m
ail/answer/14257 h66sm6105022pfe.6 - gsmtp', u'Flasky Admin reezaul.karim@gmail.com')
The text was updated successfully, but these errors were encountered: