How to setup phpmailer, smtp, and digitalocean (ubuntu 18.04)

Posted August 20, 2019 11.2k views
PHPUbuntu 18.04

Hello world,

I have developed a web app and I need to send emails from app to users for account confirmation, password reset, info, etc.

The app is written in PHP and uses phpmailer to send emails.

My question is, how can I setup smtp in digital ocean? how can I define my system’s email address (e.g.

Any kind of hint would be very appreciated.


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

You can install something like Postfix.

You can follow the steps here on how to do that:

by Justin Ellingwood
Postfix is a popular open-source Mail Transfer Agent (MTA) that can be used to route and deliver email on a Linux system. It is estimated that around 25% of public mail servers on the internet run Postfix. In this guide, we'll teach you how to get up and running quickly...