Transferring contact form input to an email account without using an email-proxy

The CF7 plugin uses WordPress built-in wp_mail() function which itself uses the PHPMailer class (github repo). The PHPMail github documentation states,

The PHP mail() function usually sends via a local mail server, typically fronted by a sendmail binary on Linux, BSD and OS X platforms, however, Windows usually doesn’t include a local mail server; PHPMailer’s integrated SMTP implementation allows email sending on Windows platforms without a local mail server.

I have not used Digital Ocean servers myself, I use hosting services that offer a cpanel interface with mail configurations. Anyhow, reading Digital Ocean forums it seems that you should be able to install sendmail directly. See this forum thread with more details.

If you are able to install sendmail and the mails are still not working on your server, I would recommend that you install the PHPMailer packckage from the GitHub repo I linked above and execute a test mail programmatically and log the full error message into your debug log file so understand where the error is coming from, and google your error to see if you can get more information on to how to solve it.

If you are not able to get sendmail to work, then I would recommend the SMTP route as proposed in @Bram answer. If you have your own email server, you should be able to configure its SMTP credentials/port and use that to configure the settings in an SMTP plugin (I use the Easy SMTP mailer plugin on my localhost as I do not have sendmail setup on my linux machine). The mail will be sent from your own email server to itself, achieving your goal.

Leave a Comment