Questions tagged [flask-mail]

The Flask-Mail extension provides a simple interface to set up SMTP with your Flask application and to send messages from your views and scripts.

The Flask-Mail extension provides a simple interface to set up SMTP with your Flask application and to send messages from your views and scripts.

249 questions
20
votes
2 answers

Configure Flask-Mail to use GMail

When I try to send an email using Flask-Mail to Gmail's SMTP server using the settings below, I get [Errno -2] Name or service not known. How do I fix my configuration to send email with Gmail? from flask import Flask, render_template, redirect,…
stevenperry94
  • 223
  • 1
  • 2
  • 6
15
votes
3 answers

flask-mail gmail: connection refused

I'm getting the following error when I attempt to use flask-mail to send an email through my gmail account. error: [Errno 10061] No connection could be made because the target machine actively refused it I've tried configuring flask-mail in…
Brett
  • 155
  • 1
  • 1
  • 5
14
votes
4 answers

Sending a mail from Flask-Mail (SMTPSenderRefused 530)

The app configuration used in a Flask Mail application (following Miguel Grinberg Flask developlemt book) : app.config['MAIL_SERVER'] = 'smtp.googlemail.com' app.config['MAIL_PORT'] = 587 app.config['MAIL_USE_TLS'] = True app.config['MAIL_USERNAME']…
Anuj
  • 6,987
  • 3
  • 22
  • 25
9
votes
1 answer

Flask Mail: how to add custom name to the sender?

I'm using Flask mail to send emails. Everything works fine except I noticed the sender name is just a first part of email like (1) - "info" in this case: How to add a custom name like (2) - see the screenshot? The code I'm sending emails with: def…
mimic
  • 4,897
  • 7
  • 54
  • 93
8
votes
3 answers

Connection refused when sending mail with Flask-Mail

I'm having trouble sending email with flask-mail ( http://pythonhosted.org/flask-mail/ ) from flask.ext.sqlalchemy import SQLAlchemy from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash from flask.ext.mail…
ArniReynir
  • 849
  • 3
  • 12
  • 29
6
votes
2 answers

Flask-Mail queue messages to be sent to different emails

I am using the Flask-Mail library for my Flask application to send a default welcome email to the user when they sign up to be added to the newsletter. After debugging the library I found that it can only handle one connection at a time to send a…
nosh
  • 620
  • 3
  • 14
  • 50
6
votes
3 answers

Flask-Mail - Sending email asynchronously, based on Flask-Cookiecutter

My flask project is based on Flask-Cookiecutter and I need to send emails asynchronously. Function for sending email was configured by Miguel’s Tutorial and sending synchronously works fine, but i don’t know, how I can modify it for sending…
lukassliacky
  • 364
  • 7
  • 25
6
votes
2 answers

Flask blueprints with gevent working outside of application context

I am trying to send emails asynchronously with in Flask with gevent via flask-mail. I am getting "working outside of application context". I am aware of with app.app_context() but I cannot get it to work with my setup. My application is created with…
alexferl
  • 629
  • 2
  • 10
  • 23
6
votes
1 answer

Using Flask-Mail asynchronously results in "RuntimeError: working outside of application context"

I am trying to send some mail asynchronously (based on the code in The Flask Mega-Tutorial, Part XI: Email Support). However, I get the following error about working outside an application context. How do I fix this problem? Traceback (most recent…
zPrima
  • 727
  • 1
  • 8
  • 20
6
votes
1 answer

Using Flask-Mail to send Email through Gmail- socket.gaierr

I am building a simple contact page using Flask and Flask-Mail. I built the app following this tutorial - Add a contact page - and now when I try to send the message I receive the eror gaierror: [Errno -2] Name or service not known. I have been…
kylieCatt
  • 10,672
  • 5
  • 43
  • 51
6
votes
1 answer

Flask-Mail - Connection Refused [Errno 111]

I am using Flask-Mail in small web application. Since the application is small I am using gmail to send emails. After following all the steps in the documentation, when I run the app to test the email feature. I keep on getting a error: [Errno 111]…
lv10
  • 1,469
  • 7
  • 25
  • 46
5
votes
1 answer

Disable logging in Flask-Mail when sending message

When sending any message via Flask-Mail, such as below, the last line with mail.send(msg) will also result in the mail headers and content being logged. Message("Hello", sender="from@example.com", recipients=["to@example.com"]) msg.body =…
Felix
  • 332
  • 1
  • 9
5
votes
1 answer

Using flask-mail with an application factory - adding mail attribute to app object

I'm building an app using Flask with an application factory design pattern. I want to use Flask-Mail in one of my views which gets registered to the app via a Blueprint. I saw from this Flask - cannot use Flask and Flask-mail instances from other…
user2993689
  • 283
  • 3
  • 11
5
votes
0 answers

SMTPServerDisconnected : Connection unexpectedly closed

here the main flask-mail code which I used for sending mail for reset password in case user forgot but when I run and code it saw me smtplib.SMTPServerDisconnected: Connection unexpectedly closed here below is init.py file code import os from…
Ketan Suthar
  • 365
  • 4
  • 13
5
votes
2 answers

Flask mail security is not meeting Microsoft Outlook's security requirements?

We have a web application that sends emails to clients and the web application is using Flask mail framework to handle that. About 2 weeks ago, our web application failed to send emails to clients and our own group of people. We use Office 365's…
calvert
  • 631
  • 10
  • 33
1
2 3
16 17