Help!! I'm not receiving emails from my website contact us form

I'm completely lost, there are so many variables and don't know where to start. I'm hoping someone with similar setup can help save my blood pressure from rising any further…

When I click the form Submit button on my WordPress site, I get the following error message:

[Email]: An unknown error occurred while sending the email message.

I have Google Workspace email. I have setup the MX Record in Linode;
I added Google Workspace TXT Record;

Next, I edited the wp-config.php file to include the following code (I also tried 'SMTP_HOST' smtp.gmail.com):

define('SMTP_USER','support@company.com'); define('SMTP_PASS', 'password'); define('SMTP_HOST','domains.google.com'); define('SMTP_FROM','support@company.com'); define('SMTP_NAME','Support Team'); define('SMTP_PORT','587'); define('SMTP_SECURE','tls'); define('SMTP_AUTH',true);
Then the following in functions.php:
add_action('phpmailer_init', 'configure_smtp'); function configure_smtp($phpmailer) { $phpmailer->isSMTP(); $phpmailer->Host = SMTP_HOST; $phpmailer->SMTPAuth = SMTP_AUTH; $phpmailer->Username = SMTP_USER; $phpmailer->Password = SMTP_PASS; $phpmailer->SMTPSecure = SMTP_SECURE; $phpmailer->Port = SMTP_PORT; $phpmailer->From = SMTP_FROM; $phpmailer->FromName = SMTP_NAME; }

I read Google Workspace documentation and enabled "SMTP relay service", used "smtp-relay.gmail.com" in wp-config.php but still not working…

Thank you.

1 Reply

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct