Repository: pimcore/pimcore (language: php)

Issue:
[Mail] Do not set fallback from address
### Improvement description

see #17202 


Discussion / hints:

Fix patch:
diff --git a/doc/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md b/doc/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md
index 1965d30004b..9946f306804 100644
--- a/doc/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md
+++ b/doc/23_Installation_and_Upgrade/09_Upgrade_Notes/README.md
@@ -19,6 +19,9 @@
 - Removed deprecated class `Pimcore\Helper\CsvFormulaFormatter`. Use `\League\Csv\EscapeFormula` instead.
 - Removed deprecated `getCachedSymfonyEnvironments()` method from `Pimcore\Tool`.
 
+#### [Mail]
+- If sender is not set in the mail, instead of setting a default `from` address, an exception is now thrown.
+
 #### [Navigation]
 - Remove deprecated `$_defaultPageType` from `Pimcore\Navigation\Page`.
 
diff --git a/lib/Mail.php b/lib/Mail.php
index e34ea557553..a500ec8bd5d 100644
--- a/lib/Mail.php
+++ b/lib/Mail.php
@@ -498,9 +498,8 @@ public function sendWithoutRendering(?MailerInterface $mailer = null): static
             }
         }
 
-        if (empty($this->getFrom()) && $hostname = Tool::getHostname()) {
-            // set default "from" address
-            $this->from('no-reply@' . $hostname);
+        if (empty($this->getFrom())) {
+            $sendingFailedException = new Exception('Missing mandatory mail parameter: From.');
         }
 
         $event = new MailEvent($this, [


Test patch: