hi all,
I am playing with flask-mai (http://pypi.python.org/pypi/Flask-Mail) in
mac. The installation is surely successful by "run easy-install
flask-mail".
My test codes are listed below:
*from flaskext.mail import Mail, Message*
*mail = Mail(app)*
*@app.route("/mail")*
*def mail_test():*
* msg = Message("Hello",*
* recipients=['shidelai@gmail.com'])*
* msg.body = "testing"*
* msg.html = "<b>testing</b>"*
* mail.send(msg)*
* return 'email'*
while i visit localhost:5000/mail, i can get the right page, *but I cant
receive the email.*
*
*
*anyone has ideas?*
--
Delai Shi 施德来
Did you install a SMTP server and have it configured with this parameters? - *MAIL_SERVER* : default *‘localhost’* - *MAIL_PORT* : default *25* - *MAIL_USE_TLS* : default *False* - *MAIL_USE_SSL* : default *False* - *MAIL_DEBUG* : default *app.debug* - *MAIL_USERNAME* : default *None* - *MAIL_PASSWORD* : default *None* - *DEFAULT_MAIL_SENDER* : default *None* - *DEFAULT_MAX_EMAILS* : default *None* - *MAIL_FAIL_SILENTLY* : default *True* - *MAIL_SUPPRESS_SEND* : default *False* On Mon, Nov 28, 2011 at 21:25, 施德来 delai <shidelai@gmail.com> wrote: > hi all, > I am playing with flask-mai (http://pypi.python.org/pypi/Flask-Mail) in > mac. The installation is surely successful by "run easy-install > flask-mail". > My test codes are listed below: > > *from flaskext.mail import Mail, Message* > *mail = Mail(app)* > *@app.route("/mail")* > *def mail_test():* > * msg = Message("Hello",* > * recipients=['shidelai@gmail.com'])* > * msg.body = "testing"* > * msg.html = "<b>testing</b>"* > * mail.send(msg)* > * return 'email'* > > while i visit localhost:5000/mail, i can get the right page, *but I cant > receive the email.* > * > * > *anyone has ideas?* > > -- > Delai Shi 施德来 > > >
*Thx, **MAIL_USE_TLS is required by gmail, the setting below is working for me: * * * * MAIL_SERVER = 'smtp.gmail.com' MAIL_USERNAME = 'xx@gmail.com' MAIL_PASSWORD = 'xxxxxx' DEFAULT_MAIL_SENDER = 'xx@gmail.com' MAIL_USE_TLS = True * On Tue, Nov 29, 2011 at 3:21 PM, Luis Fernando Barrera < lfbarrera17@gmail.com> wrote: > Did you install a SMTP server and have it configured with this parameters? > > - *MAIL_SERVER* : default *‘localhost’* > - *MAIL_PORT* : default *25* > - *MAIL_USE_TLS* : default *False* > - *MAIL_USE_SSL* : default *False* > - *MAIL_DEBUG* : default *app.debug* > - *MAIL_USERNAME* : default *None* > - *MAIL_PASSWORD* : default *None* > - *DEFAULT_MAIL_SENDER* : default *None* > - *DEFAULT_MAX_EMAILS* : default *None* > - *MAIL_FAIL_SILENTLY* : default *True* > - *MAIL_SUPPRESS_SEND* : default *False* > > > On Mon, Nov 28, 2011 at 21:25, 施德来 delai <shidelai@gmail.com> wrote: > >> hi all, >> I am playing with flask-mai (http://pypi.python.org/pypi/Flask-Mail) in >> mac. The installation is surely successful by "run easy-install >> flask-mail". >> My test codes are listed below: >> >> *from flaskext.mail import Mail, Message* >> *mail = Mail(app)* >> *@app.route("/mail")* >> *def mail_test():* >> * msg = Message("Hello",* >> * recipients=['shidelai@gmail.com'])* >> * msg.body = "testing"* >> * msg.html = "<b>testing</b>"* >> * mail.send(msg)* >> * return 'email'* >> >> while i visit localhost:5000/mail, i can get the right page, *but I cant >> receive the email.* >> * >> * >> *anyone has ideas?* >> >> -- >> Delai Shi 施德来 >> >> >> > -- Delai Shi 施德来