Forums

SendEmailError: SMTP Connection error: Check your MAIL_SERVER and MAIL_PORT settings.

Run into problem that is in the topic:

SendEmailError: SMTP Connection error: Check your MAIL_SERVER and MAIL_PORT settings.

On local machineq everything work charm. Deployed from git, without any changes. Gitting this problem and email never sent. Checked versions of packages in virtualenv. Packages the same.

Email service I'm trying to use is zoho.com, it's smpt server is smtp.zoho.com.

I don't think I need to post the code, as on local machineq everythong works fine. (let me know if that necessary

Forgot to mention. This error raised from Flask-User v0.6.19 module. which is raised when trying to connect to SMTP:

    try:
        # Construct Flask-Mail message
        message = Message(subject,
                recipients=[recipient],
                html = html_message,
                body = text_message)
        mail_engine.send(message)
except (socket.gaierror, socket.error) as e:
 raise SendEmailError('SMTP Connection error: Check your MAIL_SERVER and MAIL_PORT settings.')

Free accounts can only access the Gmail SMTP server to send email. If you use that, or if you use an email server that uses HTTP instead of SMTP, and is on the whitelist (mailgun comes to mind) then it should work fine. Alternatively, you could upgrade to a paid account -- then SMTP will work to any server.

Is that possible to add smtp.zoho.com to whitelist? If not, anyways, thank you for the support :)

Thanks in advance.

No, it wouldn't change whether it works or not. The whitelist is for http(s) connections, not smtp connections.