librelist archives

« back to archive

Regarding Flask-Mail

Regarding Flask-Mail

From:
Mmn
Date:
2013-05-19 @ 01:58
Hello,

I have been using flask for a while now. I had written my own email sending
mechanism and I found that there is a Flask-Mail package which I could
possibly use. So I tried to use it as per the documentation. However I am
getting connection refused every time.
I tried the configurations
1.
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 465
MAIL_USE_TLS = False
MAIL_USE_SSL = True
MAIL_USERNAME = 'your-gmail-username'
MAIL_PASSWORD = 'your-gmail-password'

2.
MAIL_SERVER = 'smtp.googlemail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USE_SSL = True
MAIL_USERNAME = 'your-gmail-username'
MAIL_PASSWORD = 'your-gmail-password

I have also tried various combinations of TLS and SSL.

My code
mailServer = smtplib.SMTP(mailserver, mailport)
#Only for gmail
mailServer.ehlo()
mailServer.starttls()
mailServer.ehlo()
mailServer.login(username, password)

still works with 587 as the port.

From this url, it looks like other people have found success.
http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xi-email-support

Can you please tell me what I could be doing wrong?

Regards,
-- 
--
It’'s a fact, taller people sleep longer in bed.

Re: [flask] Regarding Flask-Mail

From:
Edmond Burnett
Date:
2013-05-19 @ 02:10
I just wrote a mailer daemon this morning for a Flask app, however I used
pyzmail. I had luck with the following:

Try smtp.gmail.com with port 587, instead of smtp.googlemail.com.

Also, provide your full e-mail address as your username if you aren't
already.


On Sat, May 18, 2013 at 6:58 PM, MMN <mmn007@gmail.com> wrote:

> Hello,
>
> I have been using flask for a while now. I had written my own email
> sending mechanism and I found that there is a Flask-Mail package which I
> could possibly use. So I tried to use it as per the documentation. However
> I am getting connection refused every time.
> I tried the configurations
> 1.
> MAIL_SERVER = 'smtp.googlemail.com'
> MAIL_PORT = 465
> MAIL_USE_TLS = False
> MAIL_USE_SSL = True
> MAIL_USERNAME = 'your-gmail-username'
> MAIL_PASSWORD = 'your-gmail-password'
>
> 2.
> MAIL_SERVER = 'smtp.googlemail.com'
> MAIL_PORT = 587
> MAIL_USE_TLS = True
> MAIL_USE_SSL = True
> MAIL_USERNAME = 'your-gmail-username'
> MAIL_PASSWORD = 'your-gmail-password
>
> I have also tried various combinations of TLS and SSL.
>
> My code
> mailServer = smtplib.SMTP(mailserver, mailport)
> #Only for gmail
> mailServer.ehlo()
> mailServer.starttls()
> mailServer.ehlo()
> mailServer.login(username, password)
>
> still works with 587 as the port.
>
> From this url, it looks like other people have found success.
>
> 
http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xi-email-support
>
> Can you please tell me what I could be doing wrong?
>
> Regards,
> --
> --
> It’'s a fact, taller people sleep longer in bed.
>