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

flask-mail and twilio have same function names called Message(). how to resolve name clash

from twilio.twiml.messaging_response import MessagingResponse from flask_mail import Mail, Message flask_mail.Message("hi") Message.Message("hi") How do I explicitly tell the interpreter which package the method/function belongs to ?
0
votes
0 answers

Not receiving mail from api developed using flask-restful and flask-mail and deployed on AWS Lambda

I made an API which has mail function (async). I can able to receive email when i run the API locally, But not able to receive email when deployed over AWS Lambda. Is it require extra configurations ? All imports # coding=utf-8 import datetime…
0
votes
0 answers

How to fix "RuntimeError: Working outside of application context" even when using app.app_context()?

[2018-05-29 14:25:35,490: ERROR/ForkPoolWorker-1] Task utils.send_mail[cffafdb2-f242-4ecd-b42c-03f701d700d8] raised unexpected: RuntimeError('Working outside of application context.\n\nThis typically means that you attempted to use functionality…
0
votes
0 answers

Not able to use Google Cloud Authentication instead of mail settings

So I am trying to configure flask security to send a confirmation email when I register but it doesn't seem to work. I want to use the credentials I generated from Google Cloud instead of setting up mail settings (MAIL_SERVER, MAIL_PASSWORD,…
0
votes
1 answer

Can I use GOOGLE_APPLICATION_CREDENTIALS instead of specific mail settings

I'm trying to set up email confirmation through Flask-security and I was wondering if I could use the GOOGLE_APPLICATION_CREDENTIALS that I got from https://console.cloud.google.com/apis/credentials/serviceaccountkey instead of setting up mail…
0
votes
1 answer

How to attach file to Flask Mail received from Flask Form?

I am developing a website in Python Flask. What I have to do is to get uploaded file in one of the forms and attach it to mail. I tried solution given in similar question but it gives following error: AttributeError: 'str' object has no attribute…
0
votes
1 answer

Flask-Mail Cannot read configurations when config.from_object() is used

I have two versions of codes for sending emails Version 1 (W/O external config file) # app.py from flask import Flask from flask_mail import Mail, Message mail = Mail() app…
ksn
  • 91
  • 1
  • 1
  • 9
0
votes
1 answer

Flask-Mail Mail() instantiated twice

I am trying to understand this tutorial code. from flask import Flask from flask_mail import Mail, Message app =Flask(__name__) mail=Mail(app) # <-- This app.config['MAIL_SERVER']='smtp.gmail.com' app.config['MAIL_PORT'] =…
ksn
  • 91
  • 1
  • 1
  • 9
0
votes
1 answer

Flask Mail sending plain text only

I am sending emails with flask-mail but the email is received like a plain text, excluding the html formats and images. I can't figure out what's wrong with the code. Here is the send mail method: def send_async_email(app, msg): with…
aharding378
  • 207
  • 1
  • 3
  • 16
0
votes
1 answer

marrow mailer python keyerror encryption

import requests from marrow.mailer import Mailer, Message from app import celery from app.helpers.versioning import strip_tags @celery.task(name='send.email.post.smtp') def send_mail_via_smtp_task(config, payload): print config,payload …
vanquishers
  • 358
  • 1
  • 3
  • 18
0
votes
1 answer

Flask Mail Error: AttributeError: 'NoneType' object has no attribute 'split'

Here is the traceback for the error: Traceback (most recent call last): File "C:\PYTHON27\lib\site-packages\flask\app.py", line 2000, in __call__ return self.wsgi_app(environ, start_response) File…
user7301074
0
votes
2 answers

Error when trying to send email attachment

I'm using the following function in my program to send emails: def send_email(subject, sender, recipients, text_body): FILE_TYPES = set(['txt', 'doc', 'docx', 'odt', 'pdf', 'rtf', 'text', 'wks', 'wps', 'wpd']) form = ApplicationForm…
user7209225
0
votes
1 answer

Flask Security, Flask Mail AttributeError: 'NoneType' object has no attribute 'send'

I'm trying to implement the email function inside my Flask admin panel. I've successfully integrated it within my admin panel but the problem is when I try to send any mail, it gives me below error with…
Jessi
  • 1,378
  • 6
  • 17
  • 37
0
votes
1 answer

SMTP email sending failure by Flask-Mail when using nginx uwsgi, Connection refused error

I am trying to send email from flask my app using Flask-Mail. My code works fine when I run it from the development server but when I deployed it using uwsgi and nginx, I no longer can send email. Error traceback is provided. How can I solve this…
salmanwahed
  • 9,450
  • 7
  • 32
  • 55
0
votes
1 answer

ValueError: invalid literal for int() with base 10: 'False'

Any idea how to fix this issue? Traceback (most recent call last): File "manage.py", line 1, in from punchstarter import manager File "/app/punchstarter/__init__.py", line 29, in mail = Mail(app) File…