• FluentSMTP resets PHPMailer to “mail” mode, not SMTP mode, before every send — see helpers.php:639 ($phpmailer->isMail()), and no code path in the Outlook provider ever calls isSMTP() (only Providers\Smtp\Handler.php:45 does that, for the plain-SMTP connection type).

    That mode matters a lot for Bcc. PHPMailer only omits the Bcc: header from the generated MIME when Mailer === 'smtp' (because in real SMTP mode it delivers Bcc via an extra invisible RCPT TO command instead). Since Outlook’s mode is 'mail', PHPMailer does write a Bcc: header into the raw MIME — so at the PHP level, Bcc is present, right alongside Cc.

    But the Outlook handler throws that context away. Outlook/Handler.php:77-102 (sendViaApi()) just grabs $this->phpMailer->getSentMIMEMessage(), base64-encodes it, and POSTs the raw MIME blob to https://graph.microsoft.com/v1.0/me/sendMail (Outlook/API.php:133-142) with Content-Type: text/plain. That’s it — no structured JSON recipients are sent.

    Microsoft Graph’s raw-MIME ingestion at /me/sendMail parses To: and Cc: out of the header block fine, but doesn’t route delivery off a Bcc: header found in raw MIME content. It only honors Bcc when it’s supplied as a structured bccRecipients field. This is a known Graph API quirk with the “upload raw MIME” send path — not something this plugin’s header-building is getting wrong.

    Proof it’s architectural, not accidental: other providers in this same FluentSMTP install handle Bcc correctly because they don’t use the raw-MIME path. BaseHandler::setAttributes() (around BaseHandler.php:186-206) already extracts getBccAddresses() into $attributes['headers']['bcc'] for every provider — and Mailgun’s handler actually uses it (Mailgun/Handler.php:65,152), building its own bcc field in its API call. The Outlook handler is the one provider that ignores this pre-computed data entirely.

    Ways to actually fix it (not applying any of these yet):

    Best fix — change Outlook\Handler::sendViaApi() to stop using the raw-MIME /sendMail endpoint, and instead build the structured Graph JSON payload (message.toRecipients / ccRecipients / bccRecipients), pulling bcc from the headers.bcc array BaseHandler already computes — mirroring what Mailgun’s handler does today.

    You must be logged in to reply to this topic.