Code Complete

Another Java Blog

Skip to content
  • Home
  • Books
  • Contact Us
  • Projects
  • Subscribe

Set up a Custom Domain Email with Heroku Application

If your application is deployed in Heroku, Heroku server doesn’t provide email server by default.  In my previous post Deploying application on Heroku, I showed how to deploy a Spring Boot application in Heroku. Over to that, most applications use their custom domain and you will need email addresses with those domains for support or sales perspective.

So how do you set up custom email with your application domain? In this case, I needed to set up an email address info AT rentersvoices.com so people could contact me.

It’s a straightforward process and I will show in this post how to set up custom email.

Set up Custom Email in Heroku Application

Remember Heroku offers an option of CloudMailIn for custom email. It helps to receive incoming emails. In this post, we will not be using CloudMailIn with the restriction it has for free option in Heroku.

Instead, we are using forwardemail.net. There are few other options available like MailGun or SendGrid

To set up a custom email, you will need to add CNAME or MX records for your domain with your domain provider.

In my case, I was using NameCheap as my domain provider.

Add following MX records for your domain:

Type      Host     Value             Priority   TTL
MX Record @     mx1.forwardemail.net  10       60 min

MX Record @     mx2.forwardemail.net  20       60 min

Once we have configured MX records, we will need to configure TX records. This step is required so we can forward email coming to our custom domain to an email address of our choice.

Type          Host           Value                                     TTL
TXT Record     @         forward-email=abc@yahoo.com                  60 min
TXT Record     @         v=spf1 mx include:spf.forwardemail.net -all  60 min

After we add these records, we should wait till the cache is cleared for the domain. You might have to wait for an hour at max. Now try sending an email to custom address (in this case info AT rentersvoices.com) and you will receive that email at abc AT yahoo.com.

Conclusion

In this post, we showed how to set up an email in Heroku application. If you have any feedback, please feel free to post your comments below.

 

 

This entry was posted in Core Java, Heroku, Java, Programming, Spring-boot and tagged custom email, forwardemail, heroku, Spring-boot on March 11, 2020 by yogesh.mali@gmail.com.

Post navigation

← RentersFeedback.com is Rentersvoices.com How to resolve PKIX Path Building Failed in Docker Container →

Recent Posts

  • Building Saas in 2024
  • System Thinking
  • How Databases Work
  • NodeJS Streams Explained: A Detailed Walkthrough
  • Scaling Bull Jobs In NestJS Application

Links

Simplifying Spring Security - Book
Spring Boot and Microservices - Book
Java Developer Jobs
Yogesh Mali

Archives

  • October 2024 (1)
  • September 2024 (1)
  • August 2024 (1)
  • July 2024 (1)
  • June 2024 (1)
  • May 2024 (1)
  • April 2024 (1)
  • March 2024 (1)
  • February 2024 (1)
  • January 2024 (1)
  • December 2023 (1)
  • November 2023 (1)
  • October 2023 (1)
  • September 2023 (1)
  • August 2023 (1)
  • July 2023 (1)
  • June 2023 (1)
  • May 2023 (1)
  • April 2023 (1)
  • March 2023 (1)
  • February 2023 (1)
  • January 2023 (1)
  • December 2022 (1)
  • November 2022 (1)
  • October 2022 (1)
  • September 2022 (1)
  • August 2022 (2)
  • July 2022 (1)
  • June 2022 (1)
  • May 2022 (1)
  • April 2022 (2)
  • March 2022 (1)
  • February 2022 (1)
  • January 2022 (1)
  • December 2021 (2)
  • November 2021 (2)
  • October 2021 (2)
  • September 2021 (2)
  • August 2021 (3)
  • July 2021 (3)
  • June 2021 (2)
  • May 2021 (2)
  • April 2021 (3)
  • March 2021 (3)
  • February 2021 (3)
  • January 2021 (2)
  • December 2020 (2)
  • November 2020 (1)
  • October 2020 (1)
  • September 2020 (1)
  • August 2020 (2)
  • July 2020 (2)
  • June 2020 (2)
  • May 2020 (2)
  • April 2020 (1)
  • March 2020 (1)
  • February 2020 (2)
  • January 2020 (1)
  • December 2019 (2)
  • November 2019 (1)
  • October 2019 (1)
  • September 2019 (1)
  • August 2019 (1)
  • July 2019 (1)
  • June 2019 (2)
  • May 2019 (2)
  • April 2019 (2)
  • March 2019 (2)
  • February 2019 (2)
  • January 2019 (2)
  • December 2018 (3)
  • November 2018 (2)
  • October 2018 (3)
  • September 2018 (3)
  • August 2018 (4)
  • July 2018 (2)
  • June 2018 (2)
  • May 2018 (2)
  • April 2018 (2)
  • March 2018 (3)
  • February 2018 (2)
  • January 2018 (3)
  • December 2017 (1)
  • November 2017 (2)
  • October 2017 (3)
  • September 2017 (3)
  • August 2017 (3)
  • July 2017 (3)
  • June 2017 (3)
  • May 2017 (4)
  • April 2017 (5)
  • March 2017 (4)
  • February 2017 (1)
  • March 2016 (1)
  • February 2016 (2)
  • January 2016 (1)
  • June 2015 (1)

Ad

Proudly powered by WordPress
Go to mobile version