Question

Setup a mail server or host for sending and receiving mail for Laravel on Ubantu server

Posted October 10, 2021 69 views
EmailDNSInitial Server Setup

I want to create a mail server and want to create mail like mail@mydomain.com, mail2@mydomain.com to sending and receiving mail. The last thing I want to do is sent mail from my Laravel application and for that, I need to config this below thing in Laravel

MAILMAILER=smtp
MAIL
HOST=mailhog
MAILPORT=1025
MAIL
USERNAME=null
MAILPASSWORD=null
MAIL
ENCRYPTION=null
MAILFROMADDRESS=null
MAILFROMNAME=“${APP_NAME}”

I already have 2 droplets over here. one for testing and one for production. I don’t want to screw my production droplet (Laravel hosted droplet). I will buy another droplet for email hosting. So I need a proper solution for it. my domain is https://ghorerrannabd.com/

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hello,

You could follow the steps on how to set up an email server here:

https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin

This would include Postfix for sending out emails and Dovecot for the inbound emails.

However, keep in mind that running your own mail server could be quite challenging as described here:

https://www.digitalocean.com/community/tutorials/why-you-may-not-want-to-run-your-own-mail-server

Alternatively, you could use a control panel like cPanel which comes with an email server pre-setup and a graphical interface where you will be able to create and manage your email accounts. You can install it with One-Click via this link here:

https://marketplace.digitalocean.com/apps/cpanel-whm

Hope that this helps!
Best,
Bobby

by Nestor de Haro
In this tutorial we are going to configure a mail server using Postfix, Dovecot, MySQL, and SpamAssassin on Ubuntu 12.04.