Sending Emails in Flask Apps

  Рет қаралды 22,406

Pretty Printed

Pretty Printed

Күн бұрын

Пікірлер: 46
@prettyprinted
@prettyprinted 4 жыл бұрын
Join my free course on the basics of Flask-SQLAlchemy: prettyprinted.com/flasksql
@tusharniras
@tusharniras 7 жыл бұрын
Thanks Anthony, your videos (all) are very helpful...
@prettyprinted
@prettyprinted 7 жыл бұрын
You're welcome! And thanks for joining my stream today.
@choryyours
@choryyours 7 жыл бұрын
hi I've been following you for a while now and your videos are very helpful! I have a question though. Let's say I want to build an app that let users to type in their emails and password and send an email using that account entered. is it possible to instantiate the config during runtime? or like while the app is running?
@simplepycodes
@simplepycodes 5 жыл бұрын
awesome tutorial. my question is that when you develop Flask web app, is it a must to use flask mail for Mailing functions? why not just use, lets say smtplib? Thanks a lot.
@prettyprinted
@prettyprinted 5 жыл бұрын
You can use the library itself, but Flask-Mail just fits the Flask pattern a little better.
@simplepycodes
@simplepycodes 5 жыл бұрын
@@prettyprinted Thank you
@antheashybi1079
@antheashybi1079 6 жыл бұрын
Thank you for this video sir.. Can you please tell me..how to send bulk mail in this!
@prettyprinted
@prettyprinted 6 жыл бұрын
Here's how to send bulk emails: pythonhosted.org/Flask-Mail/#bulk-emails
@rajagopalxyz
@rajagopalxyz 7 жыл бұрын
First of all, Thanks a lot for wonderful tutorials. :) I have two questions on emails. a) Can I have multiple email backend settings ? As far as I saw only one email setting could be configured. b) Is there any way to dynamically change or choose email setting during runtime ?
@prettyprinted
@prettyprinted 7 жыл бұрын
You could, but it's hard to explain. I'll make a video on this eventually.
@fouad09
@fouad09 5 жыл бұрын
Hi, Greate tutorial btw. I am using flask-mail and the following config : app.config['MAIL_SERVER']='smtp.office365.com' app.config['MAIL_PORT'] = 587 app.config['MAIL_USE_TLS'] = True app.config['MAIL_USE_SSL'] = False when I run my app locally I am able to receive the message but when I use Heroku I receive a winmail.dat file do you have any idea how to fix this issue? thanks
@piyalisen2993
@piyalisen2993 5 жыл бұрын
I am using university proxy, what additional code needs to be written, for it to work
@ishanichakravorty9275
@ishanichakravorty9275 5 жыл бұрын
hey! thank you so much for making this video! i just wanted to ask what does if __name__ == 'main: app.run(debug=True) do?thanks!
@prettyprinted
@prettyprinted 5 жыл бұрын
It starts the server if you execute the file from the command line. If you include the file within any module, the server won't start.
@ishanichakravorty9275
@ishanichakravorty9275 5 жыл бұрын
Pretty Printed thank you
@TheNetoCampos
@TheNetoCampos 8 жыл бұрын
Hi Anthony! How are you doing? Look, I've followed this lesson and successfully managed to send a email via Flask-Mail. The problem is that when the email arrives in my inbox, it comes from the email that I provided via config (along with the password), and not from the sender email (provided when creating the message). Do you know how to send from sender? Thanks!
@prettyprinted
@prettyprinted 8 жыл бұрын
I'm doing well, thanks, Try the MAIL_DEFAULT_SENDER config value. Just beware that if the email account domain and sender domain are different, you'll likely trigger anti-spam functionality in the receiver's email inbox. Thanks for watching!
@TheNetoCampos
@TheNetoCampos 8 жыл бұрын
I'll try that. Thanks for the answer and keep the good work.
@Glauberz1
@Glauberz1 7 жыл бұрын
hello,whats written in the config.cfg file?could you post here because i am having trouble trying send email,i tried in a lot of ways but not worked.
@prettyprinted
@prettyprinted 7 жыл бұрын
My configuration file has my email information in it, so I don't want to show it. You'll have to play around with the port settings and SSL/TLS settings until you find the right combination.
@chrisc.4144
@chrisc.4144 8 жыл бұрын
This was great. Thank you !
@prettyprinted
@prettyprinted 8 жыл бұрын
Thanks for watching! (I'm just now seeing your comment).
@llamasarus1
@llamasarus1 6 жыл бұрын
Does Flask-mail only work for sending messaging messages? I want to receive messages. This only works if I put my email address as the sender but I want to be the recipient and I other people to send a messages to me through a contact form. How do I do that instead? I tried switching my email address as the recipient but I got an error....
@prettyprinted
@prettyprinted 6 жыл бұрын
You can only send emails. For receiving emails, you just use your regular email client.
@djuka8121
@djuka8121 4 жыл бұрын
Why do you need a sender if you defined it with app.config.from_pyfile('config.cfg') and inside that file is 'EMAIL_USERNAME' = 'email' and 'EMAIL_PASSWORD' = 'pass' #note that email and pass are examples
@shubhamchaudhary5916
@shubhamchaudhary5916 6 жыл бұрын
error 11003 .... socket.gaierror ... how to solve plz reply
@prettyprinted
@prettyprinted 6 жыл бұрын
It probably means the host you provided for your email is incorrect.
@wimrotor
@wimrotor 8 жыл бұрын
Always hitting this error when trying to use the Flask-Mail module: > (venv) pi@raspberrypi:/var/www/flaskapp $ python manage.py shell > ImportError: No module named flask.ext.mail Yet in my main.py: > from flask_mail import Mail, Message Yet in pip install FLask-Mail : > (venv) pi@raspberrypi:/var/www/flaskapp $ sudo pip install Flask-Mail > Requirement already satisfied (use --upgrade to upgrade): Flask-Mail in /usr/local/lib/python2.7/dist-packages Try to look on internet, but is rather not clear to me what is going wrong. If you could assist? Many thanks in advance?
@wimrotor
@wimrotor 8 жыл бұрын
Just found out that I need to run everything with "root" permissions: > sudo pip install Flask-Mail==0.9.1 > Successfully installed Flask-Mail > (venv) pi@raspberrypi:/var/www/flaskapp $ sudo pip freeze | grep "ail" > Flask-Mail==0.9.1 > (venv) pi@raspberrypi:/var/www/flaskapp $ python manage.py shell > File "/var/www/flaskapp/main.py", line 5, in > from flask_mail import Mail, Message >ImportError: No module named flask_mail BUT: (venv) pi@raspberrypi:/var/www/flaskapp $ sudo python manage.py shell >>> Is working ... ! :)
@prettyprinted
@prettyprinted 8 жыл бұрын
I'm glad you figured it out. Thanks for watching!
@marcelgiglio
@marcelgiglio 7 жыл бұрын
but there is no diferentiation between body and subject? this recipients, its cc or cco?
@prettyprinted
@prettyprinted 7 жыл бұрын
Here you can see all the parameters available: pythonhosted.org/Flask-Mail/
@arjunaefenusdesilalahi3450
@arjunaefenusdesilalahi3450 4 жыл бұрын
how to give html template on email
6 жыл бұрын
Vale, muito. bom! thanks.
@prettyprinted
@prettyprinted 6 жыл бұрын
You're welcome. Thanks for watching!
@oohachallagolla9361
@oohachallagolla9361 4 жыл бұрын
showing [Errno 101] Network is unreachable :(
@hemantgautam1
@hemantgautam1 4 жыл бұрын
How can we send attachment in the email?
@yolomein415
@yolomein415 5 жыл бұрын
how come you dont need a password, is it possible that i send from someone else's email!?
@prettyprinted
@prettyprinted 5 жыл бұрын
I do use a password. You just don't see it in the video. It's in the config.cfg file.
@yolomein415
@yolomein415 5 жыл бұрын
Pretty Printed so in the config file, do you just have a plaintext password or is it like password=“the_password”?
@prettyprinted
@prettyprinted 5 жыл бұрын
@@yolomein415 You can use quotes in the config file. So just password='the_password'
@yolomein415
@yolomein415 5 жыл бұрын
Pretty Printed thanks 🙏 i get it now!!!
@alejandrombc
@alejandrombc 8 жыл бұрын
Good bro!, can you please talk a little bit louder the next time?. Thanks!
@prettyprinted
@prettyprinted 8 жыл бұрын
+Alejandro Barone Sorry, I was using a crappy mic at the time. I just bought a new one, so hopefully sound won't be a problem. Thanks for watching!
Form Handling in Flask Using WTForms
20:00
Pretty Printed
Рет қаралды 47 М.
Using Flask-Mail to Send Email Confirmation Links
18:09
Pretty Printed
Рет қаралды 38 М.
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 179 МЛН
the balloon deflated while it was flying #tiktok
00:19
Анастасия Тарасова
Рет қаралды 35 МЛН
Using Flask-Mail to Send Emails in Flask
40:05
Pretty Printed
Рет қаралды 35 М.
Using Celery in Flask to Email Dynamic PDFs
18:06
Pretty Printed
Рет қаралды 13 М.
Sending Email From Web Forms - Python and Flask #6
7:31
Codemy.com
Рет қаралды 28 М.
Creating a Weather App in Flask Using Python Requests [Part 1]
24:58
Pretty Printed
Рет қаралды 81 М.
Send Emails in Flask - Flask Tutorial by Mailtrap
9:28
Mailtrap
Рет қаралды 6 М.
System Design Interview - Distributed Cache
34:34
System Design Interview
Рет қаралды 369 М.
Apple, Stop Putting Things On the Bottom Please
9:16
TechLinked
Рет қаралды 536 М.
World and Camera - How to Make a 2D Game in Java #5
24:49
RyiSnow
Рет қаралды 112 М.
How to Send Emails with Flask Using Python
9:10
Arpan Neupane
Рет қаралды 25 М.
Human vs Jet Engine
00:19
MrBeast
Рет қаралды 179 МЛН