Closed development-lameco closed 2 years ago
554 5.5.1 Error: no valid recipients
Does the email address actually exist you're trying to send to? You can test by sending an email to it from outside of Craft via your preferred email client.
If so, what email method are you using under Settings->Email in Craft?
Yes, as I mentioned using the Test mail
functionality in dev
mode works as expected. Also the email address for the account is a valid email address.
as I mentioned using the Test mail functionality in dev mode works as expected.
I'm taking PHP and Craft out of the equation and asking if you can successfully send an email to that address through a standalone email client.
Also:
If so, what email method are you using under Settings->Email in Craft?
Sorry for my late reply, but yes sending email with a standalone email client to that address works.
What email method are you using under Settings->Email in Craft? SMTP? sendmail? something else?
SMTP, we use Mandrill. Using port 465
and ssl
encryption method.
I just bumped into this, too. Same error message, same condition where the test email sends just fine. Also Mandrill SMTP.
Did you figure anything out @development-lameco ?
@twosixcode unfortunately not. Although I need to confirm if it also happens on other Craft instances we are running, it might be a specific instance issue as far as I know.
EDIT: I tried it on another instance using the same configuration, except an older Craft version (3.7.35) and works without any issue which makes it even more strange i guess.
Ok so after some more testing on various instances I think I found the culprit. We've set up the Email settings to all come from the .env file except the fromName
. But somehow the $EMAIL_AUTHENTICATION
was missing in the .env file and sometimes messes with sending the mail.
email:
fromEmail: $EMAIL_FROM
fromName: Lameco
replyToEmail: null
template: ''
transportSettings:
encryptionMethod: $EMAIL_ENCRYPTION
host: $EMAIL_HOST
password: $EMAIL_PASSWORD
port: $EMAIL_PORT
timeout: '10'
useAuthentication: $EMAIL_AUTHENTICATION
username: $EMAIL_USER
transportType: craft\mail\transportadapters\Smtp
Can you confirm this @twosixcode ?
In this instance we're not using .env variables for the email settings, but I took a look and we did have a blank "Reply-To Address" field. This is an optional field, and leaving it blank definitely did not cause issue with the Email Settings "Test" email being sent. But based on your comment @development-lameco I went ahead and entered the email we're using for System Email Address just as a test and the forgot password emails are sending now.
Thanks for sharing your findings!
Weird that it can have different causes. As you can see in the piece of config we mostly leave it blank. But glad I gave you a nudge in the right direction.
What happened?
Description
So we currently having this problem with sending the account related emails. On my local environment using Mailhog I receive the mails without any issues. But on our staging environment we get the following error message in de web.log file:
Testing the Mail settings it does send the mail without problem so I'm guessing it has something to do only related to account mails?
Steps to reproduce
Expected behavior
Email successfully send and received by the email in the account.
Actual behavior
Craft CMS version
3.7.41
PHP version
8.1
Operating system and version
Linux 5.4.0-109-generic
Database type and version
MySQL 10.6.7
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.0-24)
Installed plugins and versions