March 6th, 2013, 11:14 PM
Join Date: Mar 2013
Time spent in forums: 52 m 56 sec
Reputation Power: 0
Help with Flask-Mail using Heroku + Mailgun
I have been writing a simple app to test how to send emails via an SMTP method (needs to be SMTP to be portable to different SMTP services) using Flask-Mail. For this I am trying to use Mailgun through Heroku, but after much trial, error and research I still cannot seem to get emails to send.
My question is on a similar vein to this question on Stack Overflow called 'Flask on Heroku with MailGun config issues' (I tried to hyperlink but this newly registered account won't allow me to). However, I can see no resolution in the question on SO, other than to use Mailgun's API, which isn't feasible for the project I am working on.
Currently I have the flask/flask-mail code set up as follows (stripped down of course):
from flask import Flask
from flask.ext.mail import Mail
from flask.ext.mail import Message
app = Flask(__name__)
mail = Mail(app)
msg = Message("Hello",
msg.html = "<b>testing</b>"
return 'Email Sent'
if __name__ == '__main__':
Am I missing something? And is there a way to test what is going wrong as the code passes and 'Email Sent' is returned, but no email is sent/received seemingly?
Any help would be appreciated, thanks!