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
3
votes
1 answer

Flask-Security email confirmation (Flask-Mail) Fails to send without modifying flask_security/utils.py

I'm experimenting with Flask-Security and was having some trouble getting the confirmation email to send. I eventually fixed it by removing a line in flask_security/utils.py. I removed line 387, forcing flask-mail to use the app.config's mail…
John Robinson
  • 315
  • 4
  • 16
3
votes
1 answer

Flask WTF to flask-mail attachment?

Upload a file via flask-wtf and then mail it using flask-mail def careers(): form = CareersForm() if form.validate_on_submit(): msg = Message('my subject for message', sender = MAIL_USERNAME, recipients = [company_email]) …
Holly Johnson
  • 509
  • 1
  • 13
  • 25
3
votes
1 answer

AttributeError: 'NoneType' object has no attribute 'app' when trying to send mail in Flask

I'm following flask tutorial to practice to do flask-mail but I encounter something that appears to be a bug. I don't understand what happen? This is my code: def send_email(to, subject, template, **kwargs): msg =…
Burger King
  • 2,945
  • 3
  • 20
  • 45
3
votes
1 answer

flask-mail AttributeError: 'function' object has no attribute 'send'

I am trying to use flask.ext.mail to send email, however I am getting the following error. I followed a number of tutorials and they all seem to be doing the same thing, I have been looking around to see if anyone is getting this error and haven't…
awishn02
  • 39
  • 1
  • 5
3
votes
2 answers

Flask-Mail breaks Celery

I've got a Flask app where celery works fine and Flask-Mail on its own works fine as well. from celery import Celery from flask_mail import Mail, Message app = Flask(__name__) mail = Mail(app) celery = Celery('main_app', …
Stuart
  • 51
  • 1
  • 5
2
votes
1 answer

TypeError: __init__() takes 1 positional when try to send email with flask_mail

I ask this question 3 day ago and no one answer my question I developing a simpel website that use fastapi and i mount flask on fastapi i this in my app.init : from flask import Flask from flask_bootstrap import Bootstrap from app.config import…
2
votes
0 answers

Python FlasK Mail. 4.3.2 Concurrent connections limit exceeded

I am trying to send mail using python flask_mail module. The email I am using is hosted/created by godady outlook. It is able to send email successfully. However, when there are multiple users that trigger sending of email functions, I get the…
piwave2716
  • 71
  • 1
2
votes
1 answer

Create a PDF and send as attachment with flask-mail

I am trying to create a PDF from an HTML page using pdf-kit, then send that pdf as an attachment in an email. Here is my code to create the pdf, this seems to be working: html = render_template("office_report.html",role=role,…
jesseCampeez
  • 97
  • 10
2
votes
2 answers

RuntimeError: Working outside of application context. Flask - Mail

from flask import current_app as app from flask import render_template from threading import Thread from flask_mail import Message def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, subject,…
Ahmad Khidir
  • 140
  • 1
  • 9
2
votes
0 answers

Use flask-mail with Amazon SES

I want to use Flask mail with Amazon SES. I know it's possible to use the boto library instead, but in the long term, I want to use different smtps. (this is thus a different question than How to adapt flask-mail to support two SMTP accounts) So, I…
nolwww
  • 1,355
  • 1
  • 15
  • 33
2
votes
1 answer

Flask application factory pattern with Flask-Mail

I have a simple conceptual question about the Flask application factory pattern. I'm trying to use Flask-Mail across different files. My __init__.py file is: # # __init__.py # from flask import Flask from flask_pymongo import PyMongo from flask_mail…
user2415992
  • 481
  • 7
  • 22
2
votes
0 answers

Cannot send email over tls using amazon ses and flask-mail

Sending emails over ssl works fine but having trouble moving over to tls. It works fine on my local MacBook with TLS but while running the code on amazon Ec2, emails doesn't get sent. There is no error, it just drops my email silently. When I check…
jas
  • 1,539
  • 5
  • 17
  • 30
2
votes
1 answer

What does _external=True mean in flask_mail?

import os import secrets from PIL import Image from flask import url_for, current_app from flask_mail import Message from app import mail def save_picture(form_picture): random_hex = secrets.token_hex(8) f_name, f_ext =…
ThuggyTM
  • 93
  • 1
  • 12
2
votes
1 answer

flask_mail I get TWO different FROM lines mail header

I'm using flask_mail configured to use gmail smtp server. It sends mail fine except all mail looks it is coming from the gmail smtp user name and NOT from what I set in the 'sender' argument of the mail.send_message(...) command. When I look at…
dreed47
  • 51
  • 4
2
votes
2 answers

React - 404 not found

I'm having a problem making requests to my endpoint /send-email from React. I have flask-mail configured to make the async call. This is how frontend makes the request: emailClient(event, index){ let {clientCount} = this.state; var headers = { …
8-Bit Borges
  • 9,643
  • 29
  • 101
  • 198
1 2
3
16 17