1

On a virtual private server machine (Ubuntu 16.04) which I self-host on DigitalOcean I use an all-default and latest Debian stable with all-default and latest Apache, MySQL and PHP to host my WordPress websites.

Port 25 is unfiltered.

None of the WordPresses is on debug mode.

Each Wordpress website contains one simple contact form (CF7) with name, email, phone and body fields. All latest.

My problem

I declared my personal email account for all websites contact-form plugin and ought to test the forms but in testing them with some input and clicking submit I got this general error:

Failed to send your message

I didn't manage to find further data as to why I had this error - any log I checked showed nothing on this.

Reading on this I concluded I need an email proxy by a second email account, but this approach requires me to manage another email account with username and password which I don't want if I don't have to.

My need

I desire to transfer all contact-form inputs from my machine → into my personal email account, but without using an email-proxy like a third email account that will mediate between each CMS and my personal email account.

How can I transfer contact-form inputs into my personal email account without using an email-proxy, in the above stack?

1

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.

0

Apache itself does not send email. You'll need to install an email server on your server environment, free up ports on the router, and everything.

Problem: Until your IP (if this is fixed) gain reliability for the email providers (gmail, outlook, etc ...) and in fact, go at least to spam, it will take a long time.

0

The Post SMTP-plugin allows you to set up a sender e-mail account just like you would in any other client (like Outlook, Windows Mail).

It also provides testing and logging functionality, which might help you further narrow down the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.