Home > OS >  Shopware 6 unable to sent Email
Shopware 6 unable to sent Email

Time:01-16

I installed and configured Shopware 6.
I configured Emails under Settings → System → Mailer (URL …/admin#/sw/settings/mailer/index)

Unfortunately Emails are still not sent (e.g. Order confirmation or Contact form)

In var/log/prod-2023-01-15.log is see the following line :

[2023-01-15T16:26:33.140153 00:00] app.ERROR: Could not send mail: Failed sending mail to following recipients: {{ recipients }} with Error: Expected response code „250“ but got c ode „550“, with message „550 5.7.1 Sender mismatch“. Error Code:0 Template data: {„recipients“:{„[email protected]“:"[email protected]"},„senderName“:„{{ sale sChannel.name }}“,„salesChannelId“:„c6aa23ebbf0b48d490237ff19bdb47b3“,„templateId“:„5e09e2c5fdb248da8329b09b16d8b6ef“,„customFields“:null,„contentHtml“:„\n

\n The following Message was sent to you via the contact form.
\n
\n Contact name: {{ contactFormData.firstName }} {{ contactFormData.lastName }}\n
\n Contact email address: {{ contactFormData.email }}\n
\n Phone: {{ contactFormData.phone }}
\n
\n Subject: {{ contactFormData.subject }}
\n
\n Message:
\n {{ contactFormData.comment|nl2br }}
\n

\n\n“, „contentPlain“:„The following Message was sent to you via the contact form.\n\nContact name: {{ contactFormData.firstName }} {{ contactFormData.lastName }}\nContact email address: {{ contactFormData.email }}\nPhone: {{ contactFormData.phone }}\n\nSubject: {{ contactFormData.subject }}\n\nMessage:\n{{ contactFormData.comment }}\n“,„subject“:„Contact form re ceived - {{ salesChannel.name }}“,„mediaIds“:}

I tried to remove all variables form the template to make sure it is not a template issue … but then I still get the error :

[2023-01-15T16:32:14.098476 00:00] app.ERROR: Could not send mail: Failed sending mail to following recipients: {{ recipients }} with Error: Expected response code „250“ but got c ode „550“, with message „550 5.7.1 Sender mismatch“. Error Code:0 Template data: {„recipients“:{„[email protected]“:"[email protected]"},„senderName“:„PlsUseV ariable“,„salesChannelId“:„c6aa23ebbf0b48d490237ff19bdb47b3“,„templateId“:„5e09e2c5fdb248da8329b09b16d8b6ef“,„customFields“:null,„contentHtml“:„Test Contact Form / Email (HTML)“, „contentPlain“:„Test Contact Form / Email (Plain)“,„subject“:„Contact Request“,„mediaIds“:}

CodePudding user response:

550 5.7.1 Sender mismatch is an error returned by the mail server and means that the mail was rejected. This could be because the mail data is either incomplete or violates some security settings of the mail server.

Since it specifically mentions the sender, have you made sure that the mail of the sender is set? By default it should use the address set in the settings of the administration. Have a look at what is set for the Shop owners email address at Settings > Basic information in the administration and verify that it is a valid email address. You can also read the value of the setting quickly by using the CLI:

bin/console system:config:get core.basicInformation.email

Likewise you can also write the setting from the CLI:

bin/console system:config:set core.basicInformation.email [email protected]

Note: You can also set a reply-to address in the mailer settings core.mailerSettings.senderAddress but the address set in the basic information has priority and will be used instead unless it is empty. See the corresponding code here.

  • Related