Question

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

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

MAIL_MAILER=smtp MAIL_HOST=mailhog MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS=null MAIL_FROM_NAME=“${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/


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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