Postfix won't transfer WordPress contact form emails to my Gmail account
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
5
down vote
favorite
In Ubuntu 16.04 VPS with LEMP in DigitalOcean I have a WordPress web site that has a contact form I created with Contact Form 7 (CF7).
My problem
I have a problem transferring emails from my WordPress contact form (CF7) to my email (Gmail).
I must say, I'll humbly prefer a non-plugin solution.
DNS zone for my machine
A
record holding the domain.Cname
record holding awww.
variant for the domain.- Three
NS
records to associate DNS requests to my domain, with my IP and the relevant app in its machine.
I did try to add MX
records, by the automatic DigitalOcean way of doing so (by clicking Add Gmail MX records
button in the DigitalOcean DNS management tool), and 5 MX
records were added but I still had the same error after I immediately tried to send a test email from WordPress (see error below).
Currently, the DNS zone has no MX
records because I'm not sure they are even required if all I desire in the context of emails is just to send WordPress contact form inquiries to my Gmail account and I'm still in the same state with the same error.
Exact error and debug tries:
I always get the following error message, inside a a red box under the contact form:
Failed to send your message.
Due to this error, nothing is sent anywhere (not even to the Spam folder).
Trying to debug this, I ran the following code to create a log for Postfix:
touch /var/log/mail.log
- There are no errors in the Nginx logs.
The permissions are:
rw-r--r-- 1 root root
But nothing gets written in this error log after I try to send myself a test email and fail.
Reproducing my problem:
- Create a DigitalOcean Ubuntu 16.04 droplet.
- Create a LEMP stack and run a WordPress website on it.
sudo apt-get update && sudo apt-get upgrade postfix
.- Choose "internet-site" configuration.
- Type the domain of the site you work with.
- Install Contact Form 7 on your WordPress site and try to send yourself a test email.
My question
What causes this problem?
Maybe I can try something with Postfix or an alternative tool I should use like sSMTP? I'd prefer a minimal to no-conf tool. I emphasize that I don't send any other emails to my Gmail besides those landing in the WordPress contact form, nor do I send no other emails anywhere, from this machine.
In the past, I installed Postfix as described above and there weren't any problems. If you have any idea what to check, what details I should provide, please tell me and I'll edit.
Update
1) The file /etc/postfix/main.cf
is all default.
2) Output of ps -efl | grep postfix
:
5 S root 4611 1 0 80 0 - 16352 ep_pol 07:42 ? 00:00:00 /usr/lib/postfix/sbin/master -w
4 S postfix 4613 4611 0 80 0 - 16881 ep_pol 07:42 ? 00:00:00 qmgr -l -t unix -u
4 S postfix 4930 4611 0 80 0 - 16869 ep_pol 11:02 ? 00:00:00 pickup -l -t unix -u -c
0 S root 5201 5187 0 80 0 - 3236 pipe_w 12:19 pts/0 00:00:00 grep --color=auto postfix
configuration email postfix wordpress vps
add a comment |Â
up vote
5
down vote
favorite
In Ubuntu 16.04 VPS with LEMP in DigitalOcean I have a WordPress web site that has a contact form I created with Contact Form 7 (CF7).
My problem
I have a problem transferring emails from my WordPress contact form (CF7) to my email (Gmail).
I must say, I'll humbly prefer a non-plugin solution.
DNS zone for my machine
A
record holding the domain.Cname
record holding awww.
variant for the domain.- Three
NS
records to associate DNS requests to my domain, with my IP and the relevant app in its machine.
I did try to add MX
records, by the automatic DigitalOcean way of doing so (by clicking Add Gmail MX records
button in the DigitalOcean DNS management tool), and 5 MX
records were added but I still had the same error after I immediately tried to send a test email from WordPress (see error below).
Currently, the DNS zone has no MX
records because I'm not sure they are even required if all I desire in the context of emails is just to send WordPress contact form inquiries to my Gmail account and I'm still in the same state with the same error.
Exact error and debug tries:
I always get the following error message, inside a a red box under the contact form:
Failed to send your message.
Due to this error, nothing is sent anywhere (not even to the Spam folder).
Trying to debug this, I ran the following code to create a log for Postfix:
touch /var/log/mail.log
- There are no errors in the Nginx logs.
The permissions are:
rw-r--r-- 1 root root
But nothing gets written in this error log after I try to send myself a test email and fail.
Reproducing my problem:
- Create a DigitalOcean Ubuntu 16.04 droplet.
- Create a LEMP stack and run a WordPress website on it.
sudo apt-get update && sudo apt-get upgrade postfix
.- Choose "internet-site" configuration.
- Type the domain of the site you work with.
- Install Contact Form 7 on your WordPress site and try to send yourself a test email.
My question
What causes this problem?
Maybe I can try something with Postfix or an alternative tool I should use like sSMTP? I'd prefer a minimal to no-conf tool. I emphasize that I don't send any other emails to my Gmail besides those landing in the WordPress contact form, nor do I send no other emails anywhere, from this machine.
In the past, I installed Postfix as described above and there weren't any problems. If you have any idea what to check, what details I should provide, please tell me and I'll edit.
Update
1) The file /etc/postfix/main.cf
is all default.
2) Output of ps -efl | grep postfix
:
5 S root 4611 1 0 80 0 - 16352 ep_pol 07:42 ? 00:00:00 /usr/lib/postfix/sbin/master -w
4 S postfix 4613 4611 0 80 0 - 16881 ep_pol 07:42 ? 00:00:00 qmgr -l -t unix -u
4 S postfix 4930 4611 0 80 0 - 16869 ep_pol 11:02 ? 00:00:00 pickup -l -t unix -u -c
0 S root 5201 5187 0 80 0 - 3236 pipe_w 12:19 pts/0 00:00:00 grep --color=auto postfix
configuration email postfix wordpress vps
@JohnDoea I wasn't sure if permissions were at root of logging problem as my log file was automatically setup bysmtp
or another pacakage. Hopefully the answer below (no matter which option you choose) will solve the big picture problem. Just delete themail.log
file you created before installing package(s).
â WinEunuuchs2Unix
Mar 11 at 18:12
Make sure you have this in your nginx config for the PHP side of things wherever you pass things back to the PHP-FPM backend:fastcgi_intercept_errors on;
This will intercept errors and show them on the NGINX error logs.
â Thomas Wardâ¦
Mar 12 at 13:39
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
In Ubuntu 16.04 VPS with LEMP in DigitalOcean I have a WordPress web site that has a contact form I created with Contact Form 7 (CF7).
My problem
I have a problem transferring emails from my WordPress contact form (CF7) to my email (Gmail).
I must say, I'll humbly prefer a non-plugin solution.
DNS zone for my machine
A
record holding the domain.Cname
record holding awww.
variant for the domain.- Three
NS
records to associate DNS requests to my domain, with my IP and the relevant app in its machine.
I did try to add MX
records, by the automatic DigitalOcean way of doing so (by clicking Add Gmail MX records
button in the DigitalOcean DNS management tool), and 5 MX
records were added but I still had the same error after I immediately tried to send a test email from WordPress (see error below).
Currently, the DNS zone has no MX
records because I'm not sure they are even required if all I desire in the context of emails is just to send WordPress contact form inquiries to my Gmail account and I'm still in the same state with the same error.
Exact error and debug tries:
I always get the following error message, inside a a red box under the contact form:
Failed to send your message.
Due to this error, nothing is sent anywhere (not even to the Spam folder).
Trying to debug this, I ran the following code to create a log for Postfix:
touch /var/log/mail.log
- There are no errors in the Nginx logs.
The permissions are:
rw-r--r-- 1 root root
But nothing gets written in this error log after I try to send myself a test email and fail.
Reproducing my problem:
- Create a DigitalOcean Ubuntu 16.04 droplet.
- Create a LEMP stack and run a WordPress website on it.
sudo apt-get update && sudo apt-get upgrade postfix
.- Choose "internet-site" configuration.
- Type the domain of the site you work with.
- Install Contact Form 7 on your WordPress site and try to send yourself a test email.
My question
What causes this problem?
Maybe I can try something with Postfix or an alternative tool I should use like sSMTP? I'd prefer a minimal to no-conf tool. I emphasize that I don't send any other emails to my Gmail besides those landing in the WordPress contact form, nor do I send no other emails anywhere, from this machine.
In the past, I installed Postfix as described above and there weren't any problems. If you have any idea what to check, what details I should provide, please tell me and I'll edit.
Update
1) The file /etc/postfix/main.cf
is all default.
2) Output of ps -efl | grep postfix
:
5 S root 4611 1 0 80 0 - 16352 ep_pol 07:42 ? 00:00:00 /usr/lib/postfix/sbin/master -w
4 S postfix 4613 4611 0 80 0 - 16881 ep_pol 07:42 ? 00:00:00 qmgr -l -t unix -u
4 S postfix 4930 4611 0 80 0 - 16869 ep_pol 11:02 ? 00:00:00 pickup -l -t unix -u -c
0 S root 5201 5187 0 80 0 - 3236 pipe_w 12:19 pts/0 00:00:00 grep --color=auto postfix
configuration email postfix wordpress vps
In Ubuntu 16.04 VPS with LEMP in DigitalOcean I have a WordPress web site that has a contact form I created with Contact Form 7 (CF7).
My problem
I have a problem transferring emails from my WordPress contact form (CF7) to my email (Gmail).
I must say, I'll humbly prefer a non-plugin solution.
DNS zone for my machine
A
record holding the domain.Cname
record holding awww.
variant for the domain.- Three
NS
records to associate DNS requests to my domain, with my IP and the relevant app in its machine.
I did try to add MX
records, by the automatic DigitalOcean way of doing so (by clicking Add Gmail MX records
button in the DigitalOcean DNS management tool), and 5 MX
records were added but I still had the same error after I immediately tried to send a test email from WordPress (see error below).
Currently, the DNS zone has no MX
records because I'm not sure they are even required if all I desire in the context of emails is just to send WordPress contact form inquiries to my Gmail account and I'm still in the same state with the same error.
Exact error and debug tries:
I always get the following error message, inside a a red box under the contact form:
Failed to send your message.
Due to this error, nothing is sent anywhere (not even to the Spam folder).
Trying to debug this, I ran the following code to create a log for Postfix:
touch /var/log/mail.log
- There are no errors in the Nginx logs.
The permissions are:
rw-r--r-- 1 root root
But nothing gets written in this error log after I try to send myself a test email and fail.
Reproducing my problem:
- Create a DigitalOcean Ubuntu 16.04 droplet.
- Create a LEMP stack and run a WordPress website on it.
sudo apt-get update && sudo apt-get upgrade postfix
.- Choose "internet-site" configuration.
- Type the domain of the site you work with.
- Install Contact Form 7 on your WordPress site and try to send yourself a test email.
My question
What causes this problem?
Maybe I can try something with Postfix or an alternative tool I should use like sSMTP? I'd prefer a minimal to no-conf tool. I emphasize that I don't send any other emails to my Gmail besides those landing in the WordPress contact form, nor do I send no other emails anywhere, from this machine.
In the past, I installed Postfix as described above and there weren't any problems. If you have any idea what to check, what details I should provide, please tell me and I'll edit.
Update
1) The file /etc/postfix/main.cf
is all default.
2) Output of ps -efl | grep postfix
:
5 S root 4611 1 0 80 0 - 16352 ep_pol 07:42 ? 00:00:00 /usr/lib/postfix/sbin/master -w
4 S postfix 4613 4611 0 80 0 - 16881 ep_pol 07:42 ? 00:00:00 qmgr -l -t unix -u
4 S postfix 4930 4611 0 80 0 - 16869 ep_pol 11:02 ? 00:00:00 pickup -l -t unix -u -c
0 S root 5201 5187 0 80 0 - 3236 pipe_w 12:19 pts/0 00:00:00 grep --color=auto postfix
configuration email postfix wordpress vps
configuration email postfix wordpress vps
edited Mar 12 at 12:51
asked Mar 9 at 15:19
JohnDoea
23891853
23891853
@JohnDoea I wasn't sure if permissions were at root of logging problem as my log file was automatically setup bysmtp
or another pacakage. Hopefully the answer below (no matter which option you choose) will solve the big picture problem. Just delete themail.log
file you created before installing package(s).
â WinEunuuchs2Unix
Mar 11 at 18:12
Make sure you have this in your nginx config for the PHP side of things wherever you pass things back to the PHP-FPM backend:fastcgi_intercept_errors on;
This will intercept errors and show them on the NGINX error logs.
â Thomas Wardâ¦
Mar 12 at 13:39
add a comment |Â
@JohnDoea I wasn't sure if permissions were at root of logging problem as my log file was automatically setup bysmtp
or another pacakage. Hopefully the answer below (no matter which option you choose) will solve the big picture problem. Just delete themail.log
file you created before installing package(s).
â WinEunuuchs2Unix
Mar 11 at 18:12
Make sure you have this in your nginx config for the PHP side of things wherever you pass things back to the PHP-FPM backend:fastcgi_intercept_errors on;
This will intercept errors and show them on the NGINX error logs.
â Thomas Wardâ¦
Mar 12 at 13:39
@JohnDoea I wasn't sure if permissions were at root of logging problem as my log file was automatically setup by
smtp
or another pacakage. Hopefully the answer below (no matter which option you choose) will solve the big picture problem. Just delete the mail.log
file you created before installing package(s).â WinEunuuchs2Unix
Mar 11 at 18:12
@JohnDoea I wasn't sure if permissions were at root of logging problem as my log file was automatically setup by
smtp
or another pacakage. Hopefully the answer below (no matter which option you choose) will solve the big picture problem. Just delete the mail.log
file you created before installing package(s).â WinEunuuchs2Unix
Mar 11 at 18:12
Make sure you have this in your nginx config for the PHP side of things wherever you pass things back to the PHP-FPM backend:
fastcgi_intercept_errors on;
This will intercept errors and show them on the NGINX error logs.â Thomas Wardâ¦
Mar 12 at 13:39
Make sure you have this in your nginx config for the PHP side of things wherever you pass things back to the PHP-FPM backend:
fastcgi_intercept_errors on;
This will intercept errors and show them on the NGINX error logs.â Thomas Wardâ¦
Mar 12 at 13:39
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
From How to fix wordpress contact form not sending email with smtp:
Why WordPress DoesnâÂÂt Send Emails
WordPress uses the PHP mail function to send emails generated by WordPress or any contact plugin like WPForms. However, many WordPress hosting servers are not configured to use the mail function.
Additionally, in order to reduce spam, your email provider often checks whether your email is originating from the location it claims to be originating from. For example, if your email server is yahoo.com but your email claims to be sent from your websiteâÂÂs domain, chances are your form notification will be blocked before it even reaches the spam folder.
This is why we recommend using SMTP to send emails from WordPress instead of using the default PHP mail function.
SMTP (Simple Mail Transfer Protocol) is an industry standard way to send emails that use the proper authentication method to ensure email deliverability.
Seven different ways to Sunday
This section heading is because today is Sunday and the article How to fix wordpress contact form not sending email with smtp lists Seven different ways to setup SMTP:
- WP Mail SMTP: SMTP Setup
- Gmail or G Suite
- SendGrid
- Mailgun
- Postmark
- WP SES
- SparkPost
SMTP Setup
For myself I'm using the most simplest method to have cron
email me error messages and daily backup reports: Backup Linux configuration, scripts and documents to Gmail.
To summarize the steps:
sudo apt install ssmtp
sudo apt install sharutils
You also need to instruct gmail to allow less secure access to yourself in order to accept emails. It's documented in my answer above.
Your configuration file for ssmtp
MUST be changed. Here is mine:
$ sudo cat /etc/ssmtp/ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
# November 17, 2017.
# Required for cron to e-mail backups as per Ask Ubuntu answer:
# https://askubuntu.com/questions/917562/backup-linux-configuration-scripts-and-documents-to-gmail/922493#922493
#root=postmaster
root=WinEunuuchs2Unix@gmail.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
#mailhub=mail
mailhub=smtp.gmail.com:587
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
UseTLS=YES
UseSTARTTLS=YES
#Debug=YES
# Where will the mail seem to come from?
#rewriteDomain=
rewriteDomain=gmail.com
# The full hostname
hostname=alien
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
Change the above lines to your gmail account name, password and machine name:
root=WinEunuuchs2Unix@gmail.com
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
hostname=alien
Note that WinEunuuchs2UnixPassword is your gmail password not your Linux password. To get your hostname
use echo $HOSTNAME
.
Follow the links in WordPress article.
The links in the WordPress article in the first link above should be followed to setup gmail. Only refer to my link for basic overview.
Addressing your first comment, In Seven Ways to Sunday, #2 uses G Suite these instructions describe how to setupMX records
using G Suite. That said, I'm hoping Option #1 being the simplest solution meansMX records
, as you imply, won't be needed for your task.
â WinEunuuchs2Unix
Mar 11 at 18:25
I thank you for all the changes. One last thing, please. How will you configuresSMTP
to have 2 or more email addresses instead just one? It is good when you have more than one application on your server. Thanks anyway,
â JohnDoea
Mar 14 at 16:08
I now asked another question in the same context, you might want to answer there as well: askubuntu.com/questions/1014937/â¦
â JohnDoea
Mar 14 at 17:21
add a comment |Â
up vote
2
down vote
accepted
The problem seems to come from WordPress, form the configuration of the contact form in particular, as the problem also happened with sSMTP
which some consider a simpler tool than Postfix:
When I deleted the original form and created a new one, I got a green message saying that the message was sent in a test email.
Here also, I didn't get a message even to the Spam dir, but at least the response was different and the original problem had nothing to do with Postfix.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
From How to fix wordpress contact form not sending email with smtp:
Why WordPress DoesnâÂÂt Send Emails
WordPress uses the PHP mail function to send emails generated by WordPress or any contact plugin like WPForms. However, many WordPress hosting servers are not configured to use the mail function.
Additionally, in order to reduce spam, your email provider often checks whether your email is originating from the location it claims to be originating from. For example, if your email server is yahoo.com but your email claims to be sent from your websiteâÂÂs domain, chances are your form notification will be blocked before it even reaches the spam folder.
This is why we recommend using SMTP to send emails from WordPress instead of using the default PHP mail function.
SMTP (Simple Mail Transfer Protocol) is an industry standard way to send emails that use the proper authentication method to ensure email deliverability.
Seven different ways to Sunday
This section heading is because today is Sunday and the article How to fix wordpress contact form not sending email with smtp lists Seven different ways to setup SMTP:
- WP Mail SMTP: SMTP Setup
- Gmail or G Suite
- SendGrid
- Mailgun
- Postmark
- WP SES
- SparkPost
SMTP Setup
For myself I'm using the most simplest method to have cron
email me error messages and daily backup reports: Backup Linux configuration, scripts and documents to Gmail.
To summarize the steps:
sudo apt install ssmtp
sudo apt install sharutils
You also need to instruct gmail to allow less secure access to yourself in order to accept emails. It's documented in my answer above.
Your configuration file for ssmtp
MUST be changed. Here is mine:
$ sudo cat /etc/ssmtp/ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
# November 17, 2017.
# Required for cron to e-mail backups as per Ask Ubuntu answer:
# https://askubuntu.com/questions/917562/backup-linux-configuration-scripts-and-documents-to-gmail/922493#922493
#root=postmaster
root=WinEunuuchs2Unix@gmail.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
#mailhub=mail
mailhub=smtp.gmail.com:587
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
UseTLS=YES
UseSTARTTLS=YES
#Debug=YES
# Where will the mail seem to come from?
#rewriteDomain=
rewriteDomain=gmail.com
# The full hostname
hostname=alien
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
Change the above lines to your gmail account name, password and machine name:
root=WinEunuuchs2Unix@gmail.com
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
hostname=alien
Note that WinEunuuchs2UnixPassword is your gmail password not your Linux password. To get your hostname
use echo $HOSTNAME
.
Follow the links in WordPress article.
The links in the WordPress article in the first link above should be followed to setup gmail. Only refer to my link for basic overview.
Addressing your first comment, In Seven Ways to Sunday, #2 uses G Suite these instructions describe how to setupMX records
using G Suite. That said, I'm hoping Option #1 being the simplest solution meansMX records
, as you imply, won't be needed for your task.
â WinEunuuchs2Unix
Mar 11 at 18:25
I thank you for all the changes. One last thing, please. How will you configuresSMTP
to have 2 or more email addresses instead just one? It is good when you have more than one application on your server. Thanks anyway,
â JohnDoea
Mar 14 at 16:08
I now asked another question in the same context, you might want to answer there as well: askubuntu.com/questions/1014937/â¦
â JohnDoea
Mar 14 at 17:21
add a comment |Â
up vote
2
down vote
From How to fix wordpress contact form not sending email with smtp:
Why WordPress DoesnâÂÂt Send Emails
WordPress uses the PHP mail function to send emails generated by WordPress or any contact plugin like WPForms. However, many WordPress hosting servers are not configured to use the mail function.
Additionally, in order to reduce spam, your email provider often checks whether your email is originating from the location it claims to be originating from. For example, if your email server is yahoo.com but your email claims to be sent from your websiteâÂÂs domain, chances are your form notification will be blocked before it even reaches the spam folder.
This is why we recommend using SMTP to send emails from WordPress instead of using the default PHP mail function.
SMTP (Simple Mail Transfer Protocol) is an industry standard way to send emails that use the proper authentication method to ensure email deliverability.
Seven different ways to Sunday
This section heading is because today is Sunday and the article How to fix wordpress contact form not sending email with smtp lists Seven different ways to setup SMTP:
- WP Mail SMTP: SMTP Setup
- Gmail or G Suite
- SendGrid
- Mailgun
- Postmark
- WP SES
- SparkPost
SMTP Setup
For myself I'm using the most simplest method to have cron
email me error messages and daily backup reports: Backup Linux configuration, scripts and documents to Gmail.
To summarize the steps:
sudo apt install ssmtp
sudo apt install sharutils
You also need to instruct gmail to allow less secure access to yourself in order to accept emails. It's documented in my answer above.
Your configuration file for ssmtp
MUST be changed. Here is mine:
$ sudo cat /etc/ssmtp/ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
# November 17, 2017.
# Required for cron to e-mail backups as per Ask Ubuntu answer:
# https://askubuntu.com/questions/917562/backup-linux-configuration-scripts-and-documents-to-gmail/922493#922493
#root=postmaster
root=WinEunuuchs2Unix@gmail.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
#mailhub=mail
mailhub=smtp.gmail.com:587
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
UseTLS=YES
UseSTARTTLS=YES
#Debug=YES
# Where will the mail seem to come from?
#rewriteDomain=
rewriteDomain=gmail.com
# The full hostname
hostname=alien
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
Change the above lines to your gmail account name, password and machine name:
root=WinEunuuchs2Unix@gmail.com
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
hostname=alien
Note that WinEunuuchs2UnixPassword is your gmail password not your Linux password. To get your hostname
use echo $HOSTNAME
.
Follow the links in WordPress article.
The links in the WordPress article in the first link above should be followed to setup gmail. Only refer to my link for basic overview.
Addressing your first comment, In Seven Ways to Sunday, #2 uses G Suite these instructions describe how to setupMX records
using G Suite. That said, I'm hoping Option #1 being the simplest solution meansMX records
, as you imply, won't be needed for your task.
â WinEunuuchs2Unix
Mar 11 at 18:25
I thank you for all the changes. One last thing, please. How will you configuresSMTP
to have 2 or more email addresses instead just one? It is good when you have more than one application on your server. Thanks anyway,
â JohnDoea
Mar 14 at 16:08
I now asked another question in the same context, you might want to answer there as well: askubuntu.com/questions/1014937/â¦
â JohnDoea
Mar 14 at 17:21
add a comment |Â
up vote
2
down vote
up vote
2
down vote
From How to fix wordpress contact form not sending email with smtp:
Why WordPress DoesnâÂÂt Send Emails
WordPress uses the PHP mail function to send emails generated by WordPress or any contact plugin like WPForms. However, many WordPress hosting servers are not configured to use the mail function.
Additionally, in order to reduce spam, your email provider often checks whether your email is originating from the location it claims to be originating from. For example, if your email server is yahoo.com but your email claims to be sent from your websiteâÂÂs domain, chances are your form notification will be blocked before it even reaches the spam folder.
This is why we recommend using SMTP to send emails from WordPress instead of using the default PHP mail function.
SMTP (Simple Mail Transfer Protocol) is an industry standard way to send emails that use the proper authentication method to ensure email deliverability.
Seven different ways to Sunday
This section heading is because today is Sunday and the article How to fix wordpress contact form not sending email with smtp lists Seven different ways to setup SMTP:
- WP Mail SMTP: SMTP Setup
- Gmail or G Suite
- SendGrid
- Mailgun
- Postmark
- WP SES
- SparkPost
SMTP Setup
For myself I'm using the most simplest method to have cron
email me error messages and daily backup reports: Backup Linux configuration, scripts and documents to Gmail.
To summarize the steps:
sudo apt install ssmtp
sudo apt install sharutils
You also need to instruct gmail to allow less secure access to yourself in order to accept emails. It's documented in my answer above.
Your configuration file for ssmtp
MUST be changed. Here is mine:
$ sudo cat /etc/ssmtp/ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
# November 17, 2017.
# Required for cron to e-mail backups as per Ask Ubuntu answer:
# https://askubuntu.com/questions/917562/backup-linux-configuration-scripts-and-documents-to-gmail/922493#922493
#root=postmaster
root=WinEunuuchs2Unix@gmail.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
#mailhub=mail
mailhub=smtp.gmail.com:587
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
UseTLS=YES
UseSTARTTLS=YES
#Debug=YES
# Where will the mail seem to come from?
#rewriteDomain=
rewriteDomain=gmail.com
# The full hostname
hostname=alien
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
Change the above lines to your gmail account name, password and machine name:
root=WinEunuuchs2Unix@gmail.com
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
hostname=alien
Note that WinEunuuchs2UnixPassword is your gmail password not your Linux password. To get your hostname
use echo $HOSTNAME
.
Follow the links in WordPress article.
The links in the WordPress article in the first link above should be followed to setup gmail. Only refer to my link for basic overview.
From How to fix wordpress contact form not sending email with smtp:
Why WordPress DoesnâÂÂt Send Emails
WordPress uses the PHP mail function to send emails generated by WordPress or any contact plugin like WPForms. However, many WordPress hosting servers are not configured to use the mail function.
Additionally, in order to reduce spam, your email provider often checks whether your email is originating from the location it claims to be originating from. For example, if your email server is yahoo.com but your email claims to be sent from your websiteâÂÂs domain, chances are your form notification will be blocked before it even reaches the spam folder.
This is why we recommend using SMTP to send emails from WordPress instead of using the default PHP mail function.
SMTP (Simple Mail Transfer Protocol) is an industry standard way to send emails that use the proper authentication method to ensure email deliverability.
Seven different ways to Sunday
This section heading is because today is Sunday and the article How to fix wordpress contact form not sending email with smtp lists Seven different ways to setup SMTP:
- WP Mail SMTP: SMTP Setup
- Gmail or G Suite
- SendGrid
- Mailgun
- Postmark
- WP SES
- SparkPost
SMTP Setup
For myself I'm using the most simplest method to have cron
email me error messages and daily backup reports: Backup Linux configuration, scripts and documents to Gmail.
To summarize the steps:
sudo apt install ssmtp
sudo apt install sharutils
You also need to instruct gmail to allow less secure access to yourself in order to accept emails. It's documented in my answer above.
Your configuration file for ssmtp
MUST be changed. Here is mine:
$ sudo cat /etc/ssmtp/ssmtp.conf
#
# Config file for sSMTP sendmail
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
# November 17, 2017.
# Required for cron to e-mail backups as per Ask Ubuntu answer:
# https://askubuntu.com/questions/917562/backup-linux-configuration-scripts-and-documents-to-gmail/922493#922493
#root=postmaster
root=WinEunuuchs2Unix@gmail.com
# The place where the mail goes. The actual machine name is required no
# MX records are consulted. Commonly mailhosts are named mail.domain.com
#mailhub=mail
mailhub=smtp.gmail.com:587
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
UseTLS=YES
UseSTARTTLS=YES
#Debug=YES
# Where will the mail seem to come from?
#rewriteDomain=
rewriteDomain=gmail.com
# The full hostname
hostname=alien
# Are users allowed to set their own From: address?
# YES - Allow the user to specify their own From: address
# NO - Use the system generated From: address
FromLineOverride=YES
Change the above lines to your gmail account name, password and machine name:
root=WinEunuuchs2Unix@gmail.com
AuthUser=WinEunuuchs2Unix@gmail.com
AuthPass=WinEunuuchs2UnixPassword
hostname=alien
Note that WinEunuuchs2UnixPassword is your gmail password not your Linux password. To get your hostname
use echo $HOSTNAME
.
Follow the links in WordPress article.
The links in the WordPress article in the first link above should be followed to setup gmail. Only refer to my link for basic overview.
edited Mar 12 at 16:04
answered Mar 11 at 16:05
![](https://i.stack.imgur.com/2SXNl.jpg?s=32&g=1)
![](https://i.stack.imgur.com/2SXNl.jpg?s=32&g=1)
WinEunuuchs2Unix
36k759134
36k759134
Addressing your first comment, In Seven Ways to Sunday, #2 uses G Suite these instructions describe how to setupMX records
using G Suite. That said, I'm hoping Option #1 being the simplest solution meansMX records
, as you imply, won't be needed for your task.
â WinEunuuchs2Unix
Mar 11 at 18:25
I thank you for all the changes. One last thing, please. How will you configuresSMTP
to have 2 or more email addresses instead just one? It is good when you have more than one application on your server. Thanks anyway,
â JohnDoea
Mar 14 at 16:08
I now asked another question in the same context, you might want to answer there as well: askubuntu.com/questions/1014937/â¦
â JohnDoea
Mar 14 at 17:21
add a comment |Â
Addressing your first comment, In Seven Ways to Sunday, #2 uses G Suite these instructions describe how to setupMX records
using G Suite. That said, I'm hoping Option #1 being the simplest solution meansMX records
, as you imply, won't be needed for your task.
â WinEunuuchs2Unix
Mar 11 at 18:25
I thank you for all the changes. One last thing, please. How will you configuresSMTP
to have 2 or more email addresses instead just one? It is good when you have more than one application on your server. Thanks anyway,
â JohnDoea
Mar 14 at 16:08
I now asked another question in the same context, you might want to answer there as well: askubuntu.com/questions/1014937/â¦
â JohnDoea
Mar 14 at 17:21
Addressing your first comment, In Seven Ways to Sunday, #2 uses G Suite these instructions describe how to setup
MX records
using G Suite. That said, I'm hoping Option #1 being the simplest solution means MX records
, as you imply, won't be needed for your task.â WinEunuuchs2Unix
Mar 11 at 18:25
Addressing your first comment, In Seven Ways to Sunday, #2 uses G Suite these instructions describe how to setup
MX records
using G Suite. That said, I'm hoping Option #1 being the simplest solution means MX records
, as you imply, won't be needed for your task.â WinEunuuchs2Unix
Mar 11 at 18:25
I thank you for all the changes. One last thing, please. How will you configure
sSMTP
to have 2 or more email addresses instead just one? It is good when you have more than one application on your server. Thanks anyway,â JohnDoea
Mar 14 at 16:08
I thank you for all the changes. One last thing, please. How will you configure
sSMTP
to have 2 or more email addresses instead just one? It is good when you have more than one application on your server. Thanks anyway,â JohnDoea
Mar 14 at 16:08
I now asked another question in the same context, you might want to answer there as well: askubuntu.com/questions/1014937/â¦
â JohnDoea
Mar 14 at 17:21
I now asked another question in the same context, you might want to answer there as well: askubuntu.com/questions/1014937/â¦
â JohnDoea
Mar 14 at 17:21
add a comment |Â
up vote
2
down vote
accepted
The problem seems to come from WordPress, form the configuration of the contact form in particular, as the problem also happened with sSMTP
which some consider a simpler tool than Postfix:
When I deleted the original form and created a new one, I got a green message saying that the message was sent in a test email.
Here also, I didn't get a message even to the Spam dir, but at least the response was different and the original problem had nothing to do with Postfix.
add a comment |Â
up vote
2
down vote
accepted
The problem seems to come from WordPress, form the configuration of the contact form in particular, as the problem also happened with sSMTP
which some consider a simpler tool than Postfix:
When I deleted the original form and created a new one, I got a green message saying that the message was sent in a test email.
Here also, I didn't get a message even to the Spam dir, but at least the response was different and the original problem had nothing to do with Postfix.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
The problem seems to come from WordPress, form the configuration of the contact form in particular, as the problem also happened with sSMTP
which some consider a simpler tool than Postfix:
When I deleted the original form and created a new one, I got a green message saying that the message was sent in a test email.
Here also, I didn't get a message even to the Spam dir, but at least the response was different and the original problem had nothing to do with Postfix.
The problem seems to come from WordPress, form the configuration of the contact form in particular, as the problem also happened with sSMTP
which some consider a simpler tool than Postfix:
When I deleted the original form and created a new one, I got a green message saying that the message was sent in a test email.
Here also, I didn't get a message even to the Spam dir, but at least the response was different and the original problem had nothing to do with Postfix.
edited Mar 14 at 11:09
answered Mar 13 at 10:29
JohnDoea
23891853
23891853
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1013432%2fpostfix-wont-transfer-wordpress-contact-form-emails-to-my-gmail-account%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
@JohnDoea I wasn't sure if permissions were at root of logging problem as my log file was automatically setup by
smtp
or another pacakage. Hopefully the answer below (no matter which option you choose) will solve the big picture problem. Just delete themail.log
file you created before installing package(s).â WinEunuuchs2Unix
Mar 11 at 18:12
Make sure you have this in your nginx config for the PHP side of things wherever you pass things back to the PHP-FPM backend:
fastcgi_intercept_errors on;
This will intercept errors and show them on the NGINX error logs.â Thomas Wardâ¦
Mar 12 at 13:39