I have recently updated to 2.2.4 and made a few minor changes however have just noticed that order emails are now sending with the wrong from address and is not set as per settings in Store -> Configuration -> General -> Store Email Addresses as I believe normally sets this.

Header shows like below:

From: Apache <apache@server.co.uk>
Return-Path: apache@server.co.uk

However previous headers and the current live site set this correctly and am unsure why this has suddenly started. Emails sent from forgotten passwords works fine and from what I can tell this is only effecting the order and shipment emails.

I have tried debugged this through about a maze of files all the way down to Magento\Framework\Mail\Template\TransportBuilderByStore and everything seems fine back to there.

The $this->message->setFrom($result['email'], $result['name']); seems to be correct and $result['email'] and $result['name'] are correct at this stage however the from address is not set.

$this->message uses the magento\Framework\Mail\Message class which just extends Zend_Mail for the setting of the from address so am unsure what could go wrong at this stage considering the variables sent to the function look fine.

Forgotten password however does not seem to use the TransportBuilderByStore so will try and figure out what is different for forgotten password emails.

I can see a similar issue here: https://github.com/magento/magento2/issues/6146 however this is very old. Has anyone else had an issue with this recently since updating? Why would this go wrong and how can I fix?

For now my best bet is just setting the from address via vhosts for each of the multi stores like below however would like to find out why this is happening?

php_admin_value sendmail_path "/usr/sbin/sendmail -fsales@domain.co.uk  -F 'Sales Department <sales@domain.co.uk>' -t
  • 2
    Refer this issue all explanations are there, hope this will help you. github.com/magento/magento2/issues/14952 – Emipro Technologies Pvt. Ltd. May 31 '18 at 11:18
  • Wow swear i've scoured github for this issue and couldn't find. Thanks so much i'll take a read. – harri May 31 '18 at 11:24
  • @EmiproTechnologiesPvt.Ltd. That was perfect thanks for that all fixed! Hopefully they sort it for 2.2.5 – harri May 31 '18 at 12:27

You can find solution from magento patch website. Kindly go through and you can fixed this issue


Here is best result

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.