Reputation: 61
With google having disabled the access to enable access to less secure apps can anyone suggest ways in which I can send mails using flask-mail? It has to be disabled in the mail account I'm using to send mails using flask-mail.
Upvotes: 6
Views: 3218
Reputation: 2407
Note: Before proceeding please enable 2 factor authentication.
Less secure apps (https://myaccount.google.com/u/0/lesssecureapps) is no longer available.
We can use apppasswords feature provided by google via following link
https://myaccount.google.com/u/0/apppasswords
Check below image for reference, Use 16 digit code provided by google in-place of password.
Upvotes: 1
Reputation: 31
so you need to set up the App Password from setting.
This video shows how to set up App Password = link.
setps:
1. Manage your Google Account
2. Goto the Security. on left side
3.At security->Signing in to Google
1 first need on 2-setp-verfication.
2 then click App Password.then select app and device.
for me app=Mail.
device=Windows Compter.
3 A password is genrated. copy the password. It only show one time
4 used this password to login.
Upvotes: 0
Reputation: 655
I had a similar problem using sendmail and ESMTP with Google Mail, and the excellent 'sender_based_routing' patch from: http://faculty.cs.niu.edu/~rickert/cf/ which allows sendmail to choose a different relay based on email 'From:' headers; using my MS-365 corporate email selects smtp.outlook365.com , while using my personal email selects smtp.google.com.
Because I am out of mobile phone coverage while at home, I cannot enable 2-Factor authentication or use an App Token, which requires 2-factor authentication and the ability to receive SMS; my mobile phone package does not include SMS-over-WiFi, and Google's 2-factor Auth SMS messages are not sent over Google Chat SMS.
The only workaround I have found is to open a new Google WorkSpaces email account, then you can enable the SMTP relay feature, and sending email with sendmail + ESMTP then works again.
Google has thus doubled its revenue stream from me; and since I must copy every message sent by my new account to my old one, it has doubled my storage requirements, that I pay for. Clever Google! Never neglects an opportunity to squeeze more profit from its users.
Anyway, paying for 2 email accounts in order to send emails is vastly preferable to be being forced to use the horrible GMail GUI - I can use MA/GNUS Emacs to send mails - definitely worth it.
The best long term solution, which I will do as soon as I can, is setup one's own Email server , and scrap use of Google altogether - I wish I was in a position to do this, as soon as I am I will - it requires a static IP and an always-on server.
Upvotes: 0
Reputation: 129
If your problem is about google security you can use app password instead of your account password in MAIL_PASSWORD configuration, To do that you should enable 2-step verification in your Google Account and then use app password, So go to your Google Account,
Security
Signing in to Google
Enable 2-step verification
App password
Make app password and use it as your MAIL_PASSWORD
In link below you can see other options
Upvotes: 3