Sending mail in the application is a common feature. After a large number of user practice feedback, only one way to send an email is recommended, that is, using the third-party STMP service to send the email.

SMTP General settings

There are three steps for SMTP to send mail in your application:

  1. Apply the SMTP account from Mail Provider, E.g Gmail/Hotmail/QQ Mail/163
  2. Modify the SMTP setting of Superset configuration file ```

    smtp server configuration

    EMAIL_NOTIFICATIONS = False # all the emails are sent using dryrun SMTP_HOST = ‘localhost’ SMTP_STARTTLS = True SMTP_SSL = False SMTP_USER = ‘superset’ SMTP_PORT = 25 SMTP_PASSWORD = ‘superset’ SMTP_MAIL_FROM = ‘superset@superset.com’
  1. 3. Fill in the correct parameter, restart Superset
  2. ```shell
  3. systemctl restart superset
  1. test SMTP

Don’t try to configure your Cloud Server as a SMTP Server, because the routing configuration of the mail system is restricted by many factors such as domain name, firewall, routing, etc., it leads to instability, difficulty in maintenance and poor diagnosis.


SMTP Test failure

If your SMTP is correct but you can not send email, please follow the steps below to diagnose

  1. Login to Server, running these commands, using the Telnet to test SMTP connectivity
  1. //Install telnet
  2. yum install telnet -y
  3. //Test SMTP, E.g gmail mail
  4. telnet smtp.gmail.com 465
  1. If received the message “220 smtp..com Esmtp Mail Server“ or “Escape character is ‘^]’“, it means your SMTP is connectable

Your Server IP address may be blocked by the STMP Server for some reason and it not connectable

  1. If your SMTP is connectable but you still can’t send mail by SMTP, please review these below
    • If your application is using smtplib module, make sure smtplib was been included in your project
    • External access is prohibited by Security Group (out settings)