How to make my Droplet/PHP send any email?

March 30, 2015 2.4k views
PHP Email Ubuntu

Hi there,

I've been trying the whole day to make my installation of Mantisbt send any email. I am trying to configure it to use or even I tried everything I found on the net (google, mantisbt foruns, digital ocean questions) with no results.

I even tried different softwares: sendmail, PHPMailer and msmtp. When I use sendmail with gmail, I will get:
Connection timed out with
if I use, nothing will happen.

PHPMailer just says it can't connect to the SMTP host and msmtp freezes asking for recipients emails.

Another thing, if I try to telnet or smtp.mandrillapp on any port (25, 465, 587) it just keeps trying and then inform it cannot connect to the host. Tried with droplets from different regions. But, if I try with my windows it will work :(

I even created a clean droplet just to test if I did something wrong, I followed this guide to install the LAMP stack, this one to configure Mantisbt, I used the code provided by Mandrill to use PHPMailer. I checked if mod ssl was enabled on apache and also openssl on php...

I tried the same configurations on my windows machine and it works perfectly with a clean XAMP install, I just can't make it work using the droplet, no errors are shown in the logs, no warnings, no info, nothing. it looks like everything is fine but it doesn't send any email. I would be really happy if anyone could help me or even tell me that someone made it work somehow, somewhere, I am willing to create/destroy thousands of drolets if necessary just to make it work!!!

3 Answers

Mandrillapp is the way to go, so you got that right, but I think your droplet ip maybe block by DO on mail ports, try creating a droplet on another geographical zone, and with the clean brand new droplet try telnet

telnet 587

it should show this:

Connected to
Escape character is '^]'.

If you can connect then open a support ticket to DO asking to open those ports (587 if you keep with mandrill).

New accounts have a block on the ports 587 and 25 to prevent spam. If you wish to confirm just try a telnet (e.g. telnet 25). You must open a ticket to request the unblock.

Thank you guys, I have already tried different locations with the same result. I am going to open a ticket right now!


  • Hi,

    How did you solvede the problem? We are facing same issue. we try to send emails from php using an external SMTP server.
    thanks a lot

  • Hi,

    You have to open a ticket and ask the DO team to open the ports for you. They will ask for some information about you and the reason you want SMTP ports open. They will probably open the ports right away once they receive the information.

Have another answer? Share your knowledge.