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

Sending async email with Flask-Security

I'm attempting to configure Flask-Security to send email asynchronously. I have some code which send async email via Flask-Mail, but I'm having trouble integrating it with my application factory function so that it works in conjunction with…
Josh
  • 662
  • 11
  • 27
2
votes
1 answer

Flask mail only sending to certain domains

I have a Flask application that uses an email server at Bluehost to send mail. Flask-mail successfully sends the email (I don't see any errors in the logs) however the email never arrives to Gmail accounts (not in spam or anything either). However,…
alexizydorczyk
  • 850
  • 1
  • 6
  • 25
2
votes
1 answer

error: [Errno 111] Connection refused in flask -mail

I have two demos, the first does not work, but the second works. I want to understand why. Error: raise err error: [Errno 111] Connection refused __init__.py mail = Mail() MAIL_SERVER = 'smtp.gmail.com' MAIL_PORT = 465 MAIL_USE_TLS =…
user455318
  • 3,280
  • 12
  • 41
  • 66
2
votes
1 answer

SMTPServerDisconnected: please run connect() first

I'm exploring flask and attempting to setup a simple web app with secure registration and sign in. I'm using flask-security to do this. Unfortunately, when I navigate to the send confirmation page I'm getting the error: "smtpserverdisconnected:…
Jeffrey Rogers
  • 307
  • 1
  • 2
  • 8
2
votes
3 answers

Flask SMTP authentication error

I am having issues in adding a contact page to a webpage. I am using Flask to do this. The section I dont understand is this: app.config["MAIL_SERVER"] = "smtp.gmail.com" app.config["MAIL_PORT"] = 465 app.config["MAIL_USE_SSL"] =…
user3182194
  • 1,729
  • 2
  • 13
  • 9
2
votes
1 answer

Flask-mail bulk HTML email sending with farsi font in html

with mail.connect() as conn: for user in selectemail: message1 = request.form['htmltext'] sender='garni.kh@gmail.com' subject = "hello, %s " %user[1] msg = Message(recipients=[user[0]], html=message1, …
garni
  • 45
  • 1
  • 8
1
vote
1 answer

Email component in flask application is not able to access the app instance in an application factory pattern

I am practising flask. I have made a simple flask app which sends an email to the admin saying "New User has joined." once someone enters their name and submit on the form. This is email component: from flask import current_app, render_template from…
1
vote
0 answers

I can't send emails using Flask-Mail when I initialize the app from another file

Im trying to send an email when certain button is pressed. It works when I change app = Flask(name) directly instead of app = create_app() in the app.py app.py from website import create_app from flask import Flask, request, render_template from…
Snatking09
  • 11
  • 1
1
vote
0 answers

400 Request error on sending mail on hosted server

I have a site developed in flask framework and it is hosted on a server. It has email sending feature using smtp lib which will send mail to the registered user in a zip format . Problem that i'm facing is that it is working fine in the localhost…
1
vote
2 answers

Error in python Flask-Mail, I have KeyError MAIL_DEFAULT_SENDER or other

` import re import os from flask import Flask, request, render_template, current_app from flask_mail import Mail, Message app = Flask(__name__) app.config['MAIL_DEFAULT_SENDER'] = os.environ['MAIL_DEFAULT_SENDER'] app.config["MAIL_PASSWORD"] =…
1
vote
2 answers

Flask-Mail how to add multiple files to message?

I want to add several files like attachment, but I can not understand how. My code now looking like. @form.post('/') def get_data_from_form(): message = request.form['message'] grecaptcha = request.form['g-recaptcha-response'] remote_ip…
1
vote
1 answer

Error when trying to send emails with Flask and Gmail

I'm trying to use Gmail to send emails from my flask application but I'm getting this error message: smtplib.SMTPSenderRefused: (530, b'5.7.0 Authentication Required. I've reviewed all related questions and here are the solutions I've tried: Turn…
1
vote
2 answers

Password protection for public github

I am creating a personal website using flask and python. I am using flask-mail to set up a smtp server with gmail, which requires the credentials of a gmail account. I wanted to know if there was a way to encrypt or protect the password and account…
1
vote
3 answers

Flask-Mail [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)

I'm developing a Flask application that implements a user registration system. The application uses Flask-Mail and itsdangerous to confirm a user's registration and reset their password via email. I configured Flask-Mail to use the recommended…
serrobit
  • 21
  • 1
  • 6
1
vote
0 answers

Flask Mail : How to set Do Not Forward flag

Need to send mail with "Do Not Forward" flag using flask mail. Can someone help here?
Vaibhav Sawant
  • 341
  • 1
  • 7
  • 22