From 82b0d31e03690fbb20ee1b9fa72a3073153817b2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 22:43:49 +0000 Subject: [PATCH] Fix mail From/FromName bleeding between email deliveries Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com> --- src/Appwrite/Platform/Workers/Mails.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Appwrite/Platform/Workers/Mails.php b/src/Appwrite/Platform/Workers/Mails.php index f144c58e1b..22949586df 100644 --- a/src/Appwrite/Platform/Workers/Mails.php +++ b/src/Appwrite/Platform/Workers/Mails.php @@ -162,6 +162,10 @@ class Mails extends Action $fromEmail = $customMailOptions['senderEmail'] ?? $mail->From; $fromName = $customMailOptions['senderName'] ?? $mail->FromName; $mail->setFrom($fromEmail, $fromName); + } elseif (empty($smtp)) { + $fromEmail = System::getEnv('_APP_SYSTEM_EMAIL_ADDRESS', APP_EMAIL_TEAM); + $fromName = \urldecode(System::getEnv('_APP_SYSTEM_EMAIL_NAME', APP_NAME . ' Server')); + $mail->setFrom($fromEmail, $fromName); } if (!empty($customMailOptions['replyToEmail']) || !empty($customMailOptions['replyToName'])) {