We are moving to Discord!

Join us on the Countly Community Discord Server! Engage in discussions, share your feature ideas, and learn from fellow Countly users to build exceptional apps and experiences.

How to do the mail configuration on countly server?

Hi all,

How to do the mail configuration on countly server? Can I configure the mail delivery on the same server as countly?

What would be the steps?


Thanks in advance :)



1 comment
  • Official comment

    Hi Simone,

    Thanks for reaching out!

    For email configuration, you can follow these steps:

    Configure Email Delivery

    Due to potential spam issues, you need to ensure that you configure your DNS records (explained below), so that emails sent from Countly (e.g. when you add a new user or daily/weekly email reports) can be sent and not caught by SPAM preventions.

    Here are a few important things you should check first:

    1. Ensure your ISP has a reverse DNS record entered to associate the domain names and IP addresses from which you send mail. Test your Reverse PTR record here. If your ISP does not enter the proper reverse DNS pointer record, it's very unlikely any of your emails will be delivered.
    2. Is your domain's SPF record correct? Test your SPF record here. Note that TXT is the correct official record type for SPF.
    3. Is your domain's DKIM record correct? This will significantly improve email deliverability. Test your DKIM record here.
    4. If you run your own mail server, check to ensure your mail server IPs are not on any email blacklists. Also, verify that it is definitely sending a fully qualified hostname that resolves in DNS in its HELO message. If not, this will cause your email to be rejected by many mail services.

    We highly recommend you send a test email to mail-tester.com to verify that everything mentioned above is working correctly.

    Using a Third-party Email Server

    1. Rename this file (countly/extend/mail.example.js in your Countly directory) to countly/extend/mail.js.
    2. Add your email server information. An example has been provided below:
    module.exports = function(mail){
        //define this if you need to send email from some third party service
        mail.smtpTransport = nodemailer.createTransport(smtpTransport({
            host: "example-mailserver-host.com",
            secureConnection: true,
            port: 2525,
            auth: {
                user: "your-mailserver-username",
                pass: "your-mailserver-password"

    Please let us know if you have more questions :)

    Comment actions Permalink

Please sign in to leave a comment.