Mail Setup Using Zoho

I am trying to get mail setup using Zoho. Has anyone done this successfully?

After configuring my mail.yml and re provisioning the server I get 504 bad gateway.

I try to submit a form from gravity forms and test resetting password and get the same error for both. Not sure what I am missing here.

I also noticed that in my mail.yml I have mail_admin but there is no reference to this in the Docs.

Did you read the Trellis documentation?

Yes I did read it. Unless I missed something in the mail section. As far as I can tell all my settings look fine but something has to not be configured right.

Any log entries when WP attempts to send an email (e.g. the forgot password email)?

It’s just standard SMTP so I doubt it’s Trellis itself. Make sure you have the credentials and settings correct.

Here are Zoho docs: https://www.zoho.com/mail/help/zoho-smtp.html#alink3

I’m back on this today so I will make sure I have all the correct info and try again.

What should the mail_admin be? In the docs for trellis mail there is nothing talking about this.

How can you possibly troubleshoot a mail issue without examining your logs?

Im looking into the logs right now. Just trying to figure out how to do this in Digital Ocean

Sorry for asking these questions but this is the first time I have had to setup emails this way. So I’m kind of learning as I go here.

Here is what I am seeing in the log

Jun 21 18:32:12 friendlystorewyo sSMTP[9226]: Invalid response SMTP Server (STARTTLS)
Jun 21 18:32:12 friendlystorewyo sSMTP[9226]: Cannot open smtp.zoho.com:465
Jun 21 18:33:36 friendlystorewyo sSMTP[9232]: Invalid response SMTP Server (STARTTLS)
Jun 21 18:33:36 friendlystorewyo sSMTP[9232]: Cannot open smtp.zoho.com:465
Jun 22 02:38:03 friendlystorewyo sSMTP[10968]: Creating SSL connection to host
Jun 22 02:40:13 friendlystorewyo sSMTP[10968]: Invalid response SMTP Server (STARTTLS)
Jun 22 02:40:13 friendlystorewyo sSMTP[10968]: Cannot open smtp.zoho.com:465
Jun 22 13:14:46 friendlystorewyo sSMTP[16194]: Creating SSL connection to host
Jun 22 13:14:47 friendlystorewyo sSMTP[16194]: SSL connection using RSA_AES_128_CBC_SHA1
Jun 22 13:14:49 friendlystorewyo sSMTP[16194]: 553 Relaying disallowed as WordPress <wordpress@friendlystorewyo.com>
Jun 22 13:23:30 friendlystorewyo sSMTP[18428]: Creating SSL connection to host
Jun 22 13:23:31 friendlystorewyo sSMTP[18428]: SSL connection using RSA_AES_128_CBC_SHA1
Jun 22 13:23:31 friendlystorewyo sSMTP[18428]: Authorization failed (535 Authentication Failed)

I have to be missing something zoho. I will keep digging but if anyone has a suggestion please let me know. Thanks for the help.

Here are my settings in mail.yml

mail_smtp_server: smtp.zoho.com:587
mail_admin: support@friendlystorewyo.com
mail_hostname: friendlystorewyo.com
mail_user: support@friendlystorewyo.com
mail_password: "{{ vault_mail_password }}" # Define this variable in group_vars/all/vault.yml

I got the standard wordpress emails working.

The weird part here is that the email that is specified in the log is wordpress@friendlystorewyo.com. I never created this and as you can see from my mail.yml settings it should be support@friendlystorewyo.com.

Changing this to wordpress@friendlystorewyo.com allowed the other emails to work but where does this email even come from. Is there another setting somewhere that I am missing. I have scoured the files and cannot find anything yet. I did a file search and there in no reference to wordpress@friendlystorewyo.com.

You might have to change that from address in WP itself? Check https://tommcfarlin.com/smtp-server-in-wordpress/ for details.

For anyone else arriving in this thread, here’s a simple explanation & a way of changing the sender email:

https://codex.wordpress.org/Plugin_API/Filter_Reference/wp_mail_from

add_filter('wp_mail_from', function($email) {
  return get_option('admin_email');
});