You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Emails sent through custom SMTP provider are missing the "To" header #12365
Emails sent using Appwrite Messaging with a custom SMTP provider appear to be delivered successfully, but the received email does not contain or display a proper To recipient field in email clients such as Gmail.
I found another user on the Appwrite Discord with the same issue. They were also using a custom SMTP provider and were not able to find a workaround.
Reproduction steps
Configure Appwrite Messaging with a custom SMTP provider.
Create an email message using the Appwrite Server SDK.
Send the email to a user or target using Messaging.createEmail().
Open the received email in Gmail or another email client.
Check the visible email headers / recipient information.
👍 Expected behavior
The delivered email should include a proper To header, and email clients should display the recipient normally.
Not a maintainer, but I found one implementation detail that seems relevant here.
In src/Appwrite/Platform/Workers/Messaging.php, buildEmailMessage() has this SMTP-specific branch:
// For SMTP, move all recipients to BCC and use default recipient in TO fieldif ($provider->getAttribute('provider') === 'smtp') {
foreach ($toas$recipient) {
$bcc[] = ['email' => $recipient];
}
$to = [];
}
So for custom SMTP providers, Appwrite appears to intentionally clear the normal To list and move recipients to BCC. That would explain Gmail not showing a visible To recipient, even though delivery succeeds.
Two checks that would make this issue easier to confirm:
open "Show original" in Gmail and verify whether the raw MIME has no To: header but has the recipient in Bcc/envelope handling
compare the same message through a non-SMTP provider, if available, to see whether the visible To header returns
If the current behavior is intentional for privacy/bulk-send reasons, maybe the fix is documentation or an SMTP provider option like "show recipients in To". If it is not intentional, the likely area is that SMTP branch rather than the SDK call itself.
Activity
DEATHGOD89 commentedon May 23, 2026
I'd like to work on this issue.
mdsayeem commentedon May 27, 2026
I'd like to work on this issue.
vaguul commentedon Jun 1, 2026
Not a maintainer, but I found one implementation detail that seems relevant here.
In
src/Appwrite/Platform/Workers/Messaging.php,buildEmailMessage()has this SMTP-specific branch:So for custom SMTP providers, Appwrite appears to intentionally clear the normal
Tolist and move recipients to BCC. That would explain Gmail not showing a visibleTorecipient, even though delivery succeeds.Two checks that would make this issue easier to confirm:
To:header but has the recipient inBcc/envelope handlingToheader returnsIf the current behavior is intentional for privacy/bulk-send reasons, maybe the fix is documentation or an SMTP provider option like "show recipients in To". If it is not intentional, the likely area is that SMTP branch rather than the SDK call itself.
Omvrit commentedon Jun 15, 2026
Hey, I would like to work upon it issue