Mailgun

      Mailgun


        Article Summary

        Getting started

        Create your Mailgun account

        1. Create an account with Mailgun. Mailgun offers 5,000 free emails per month for 3 months on their lowest Flex plan. Beyond that, you'll need to pay for email sending from $0.80 / 1000 emails or upgrade to a higher plan.
        2. Activate your Mailgun account. Open the Mailgun activation email you received in the email account you used for signup and follow the instructions provided.

        Adding your email domain name to Mailgun

        1. In Mailgun, go to Sending > Domains > click the Add New Domain button – or click here.
        612051e-Screenshot2020-03-20at145159.jpgIn Mailgun, go to Sending > Domains > click the Add New Domain button
        1. Add your domain name. If your email is bob@mycompany.com, then your domain name is everything after the "@" symbol - mycompany.com. It's a good idea that you use a subdomain such as mailgun.mycompany.com- see more info here. You will still be able to send emails from your regular mycompany.com domain.
        2. We recommend checking the box Create DKIM Authority and selecting the option for 2048 DKIM key-size for increased security.
        DKIM Length

        Some DNS providers may have an issue with 2048-bit DKIM keys, as they produce a TXT string longer than 255 characters (exceeding the maximum character limit for a DNS entry). In that case, reach out to their Support Team to see how to split one long TXT string into multiple smaller ones, or simply use 1024 DKIM key-size that will have fewer characters.

        93151c3-Screenshot2020-03-20at145835.pngAdd your domain name, select your nearest region, and select the appropriate DKIM key bit-size.
        1. On the following page, save the list of DNS records using the Print/Save button toward the top right. Keep this tab open for easy copy-paste. Example:

        Adding the DNS entries

        1. Log into your domain registrar/host and navigate to the DNS settings

          Pro Tip: Follow the links to see guidance on adding new DNS records

          Revisit the You'll Need Your Domain Host Credentials section and click on the various domain hosts listed for examples of modifying DNS entries.

        2. Create the TXT record for SPF. If you don’t already have a TXT record with a SPF value listed, you can use what Mailgun provided. If you already have a TXT record with an SPF value, you’ll need to modify it to match this format: v=spf1 include:mailgun.org all include:YOURDOMAINEMAIL.com all- replacing the all-CAPs portion to represent your domain name. Do not forget to enter the right Hostname
          field (if you added your domain as a subdomain in previous step).

        3. Create the "domainkey" DKIM TXT record Mailgun listed

        4. If you already have MX records listed, do not add the Mailgun-provided MX records.

        5. Add the CNAME record Mailgun provided.

        6. Save your DNS changes.

        7. Back in Mailgun, click the Verify DNS Settings button.

        DNS changes take 24-48 hours

        After you save your DNS records, it will take approximately 24-48 hours to propagate them globally.

        Configuring Close to work with Mailgun's SMTP

        1. Once your DNS settings are verified (usually 24-48 hours later), log into your Mailgun account in your web browser
        2. Go to Sending > Domains > Click your domain name
          to use that domain name
        3. Go to Sending > Domain settings > SMTP credentials
        4. Here, you'll see your current SMTP login details - keep this info handy for the following steps!
          0b4b5d4-Screenshot2020-03-20at151005.pngExample SMTP information
        5. Open the Close app and navigate to Settings > Accounts & Apps > + Add account > Custom Email, enter your Login email, press Continue, and on the screen below toggle off Enable email syncing option
          92a5db7-Screenshot2020-03-20at151304.pngClick "Custom Configuration" and toggle off "Enable email syncing"
        6. Enter your SMTP details you noted in step #4 above and then click Save

        Testing it out

        You should have a Custom server in your Connected Accounts:

        c12f8b1-Screenshot2020-03-20at151439.pngCustom SMTP Server in Connected Accounts

        Go to a lead and try to send a new email using your Mailgun custom server by changing the From field:

        6c8e04a-Screenshot2020-03-20at151744.jpgChanging From email address

        If needed, you can change name/email from which you are sending by going to Close app > Settings > Accounts & Apps > Custom server > Add a From Address - just make sure to provide the correct domain. For example, if you've connected mailgun.mycompany.com then your email address alias must be something@mailgun.mycompany.com.

        Most countries have specific laws that specify how you may utilize bulk email. You're responsible to abide within the applicable regulations, but an honorable (and recommend!) first step is to enable the option to unsubscribe from future emails. This will also help with keeping your email domain off of globally-monitored black lists.

        You can add %unsubscribe_url% to the bottom of any email templates you'd like to bulk message and Mailgun will rewrite the message to include an unsubscribe link and manage the process of not sending emails to people who have opted-out. More details at Tracking unsubscribes via Mailgun.

        Bounces in Mailgun

        For bounced replies, Mailgun automatically handles them and doesn’t send a copy to your inbox. Mailgun sends all bounced reply emails to a random bounce email address (e.g. bounce+5b6b50.9df4bb-user=domain.com@mycompany.com) on the authenticated domain that doesn’t actually exist. That way, Mailgun can track bounces and you don’t have to deal with noise in your inbox. On the Close end of things, we will ultimately only reflect what is shown in your Gmail inbox.

        To get insight into the bounces, Mailgun provides an exportable list of all bounced email addresses that you can use to update your information in Close using our Importer. It's also possible to create an integration between Mailgun and Close to update the information automatically using our third-party integration, Zapier.

        There are a few different ways you can automatically update the information in Close. You could change the lead's status, add a note to the lead, change a field within the contact, etc. We recommend using Zapier to create a Mailgun Trigger for New Bounce Event with a Close Search step of Find Lead, then a Close Action step of Update Lead and then changing the status of the Lead to something like "Bounce."

        4129b1a-Screenshot2020-03-20at154504.pngSample Zapier workflow to update Lead status when there is a new Mailgun bounce event

        For questions on setup, you can reach out to support@close.com.


        What's Next