add ownermail as "setfrom". Without this the email method ends always in status "phpmailer"and not "smtp"

This commit is contained in:
Thomas Dartsch 2024-04-11 15:31:55 +02:00
parent 935a935618
commit 30dc8f445a

View File

@ -78,9 +78,12 @@ class MailConfigCheck extends AdminDetailsController
protected function getCurrentMailer() protected function getCurrentMailer()
{ {
try { try {
$shop = Registry::getConfig()->getActiveShop();
$mail = oxNew(Email::class); $mail = oxNew(Email::class);
$mail->setRecipient($this->testMailAddress); $mail->setRecipient($this->testMailAddress);
$mail->setBody('.'); $mail->setBody('.');
$mail->setFrom($shop->getFieldData('oxowneremail'));
set_error_handler([$this, 'exceptions_error_handler']); set_error_handler([$this, 'exceptions_error_handler']);
$mail->send(); $mail->send();
$this->addTplParam('mailer', $mail->getMailer()); $this->addTplParam('mailer', $mail->getMailer());