[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Mailer General Error: An email must have a From or a Sender header

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <68f60f728ca12_2c47592830480@gitlab-sidekiq-low-urgency-cpu-bound-v2-57765bf7b5-476v9.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
1ec9726a by ushindi bienvenu at 2025-10-20T10:16:51+00:00
[FIX] Mailer General Error: An email must have a From or a Sender header
---
* [FIX] Email: Mailer General Error: An email must have a From or a Sender header

See merge request tikiwiki/tiki!8814

- - - - -


1 changed file:

- lib/mail/maillib.php


Changes:

=====================================
lib/mail/maillib.php
=====================================
@@ -191,7 +191,7 @@ function tiki_get_admin_mail($fromName = null)
         try {
             $mail->from(new Address($prefs['sender_email'], $fromName ?: $prefs['sender_name']));
         } catch (Throwable $e) {
-            // was already set
+            error_log("Mailer General Error: " . $e->getMessage());
         }
     }
 
@@ -233,6 +233,10 @@ function tiki_send_email($email)
     } catch (TransportExceptionInterface $e) {
         error_log("Mailer Transport Error: " . $e->getMessage());
     } catch (Throwable $e) {
-        error_log("Mailer General Error: " . $e->getMessage());
+        if (str_contains($e->getMessage(), 'An email must have a "From" or a "Sender" header')) {
+            Feedback::error(tr('Unable to send email: sender email not configured.'));
+        } else {
+            error_log("Mailer General Error: " . $e->getMessage());
+        }
     }
 }



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/1ec9726ac309b7a2c871afd9853bb5776b4f0eac

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/1ec9726ac309b7a2c871afd9853bb5776b4f0eac
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.