How to setup Mailhog in Ubuntu PHP Magento 2?

MailHog tools are used to test mail functionality from your local development environment.

If you are using Linux/Ubuntu OS with PHP language and want to set up MailHog for your local setup. MailHog tool is the best suited for your system to test web application mails.