I am running Drupal 8 on a DigitalOcean server. I am trying to use the standard Drupal 8 Contact form to get user's email addresses. I currently have the form up and it is visible and holds the information I want but when the user submits their message the form does not send an email to the address that it is set to and two pop ups tell the user that the email is not sent and the message is sent. The message is saved to the contact form storage module that I have downloaded but the email is not sent out. Can anyone help me solve this? I have checked my MX records and the email address that is used in the contact form and is a valid gmail that I have control of and is currently redirected from our server. I am unsure how to solve this issue please help
1 Answer
Most likely you don't have an MTA(Mail Transfer Agent) installed/configured on your droplet. You need to install Postfix so that it can be used to send emails by local applications.
Below is some info from DigitalOcean tutorials library on how to install/setup/test Postfix.
How To Install and Setup Postfix on Ubuntu 14.04
How To Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 14.04
How To Install and Configure Postfix on Ubuntu 16.04
How to Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 16.04
Another option is to use SMTP Authentication Support module
This module allows Drupal to bypass the PHP mail() function and send email directly to an SMTP server. The module supports SMTP authentication and can even connect to servers using SSL if supported by PHP.
-
I have added SMTP Authentication Support found at link. Do I still need to set up postfix in order to get this to work? I have followed guides on the SMTP Authentication support such as link and it is all set up according to that blog on my end but still does not work. Commented Jun 9, 2016 at 22:58
-
@P.Burden You don't need to install Postfix for SMTP Auth module to work. The module is in early stages of development and there are pending patches that you should keep an eye on. Are there any errors in dblog (admin/reports/dblog). Did you try enabling debug mode in SMTP module settings, to check if everything is in order?– oksana-cCommented Jun 9, 2016 at 23:59
-
edit: SMTP module's version for D8 is in early stages of development.– oksana-cCommented Jun 10, 2016 at 0:06
-
There are errors in dblog. I did enable debug mode in SMTP module settings, I was unsure where to find these logs thank you. The most recent one says Type: mail Date: Thursday, Jun 9, 2016 -18:54 User P.Burden Location: mysite.com/admin/config/systems/smtp Referrer: mysite.com/admin/config/systems/smtp Message: Error sending email (from [email protected] to [email protected] with reply-to not set). Severity: Error Hostname my host Operations Commented Jun 10, 2016 at 0:11
-
Is there at least a way to keep the message that says the email is not sent from being displayed or would you sugges that I set up postfix? Commented Jun 10, 2016 at 0:23