I sending email from one custom module so everything is working fine but If I change from , I am not getting emails.
public function beforeSendMessage(\Magento\Email\Model\Transport $subject) {
$message = $subject->getMessage();
$message->setFrom(array('email' => '[email protected]', 'name' => 'SenderName'));`
}
I tried Sales Emails going via wrong email address magento 2.2.x but doesnt help
$message
is not definedsendMesage
method. You might get a problem if there is an attempt to set the from header twice - but that should throw an exception from Zend_Mail class. You can try$message->clearFrom()
before