symfony / google-mailer
Symfony Google Mailer Bridge
Package info
github.com/symfony/google-mailer
Type:symfony-mailer-bridge
pkg:composer/symfony/google-mailer
Requires
- php: >=8.4.1
- symfony/mailer: ^7.4|^8.0
Requires (Dev)
- symfony/http-client: ^7.4|^8.0
This package is auto-updated.
Last update: 2026-08-02 09:30:58 UTC
README
Provides Google Gmail integration for Symfony Mailer.
Configuration example:
# SMTP MAILER_DSN=gmail+smtp://USERNAME:APP-PASSWORD@default # Gmail API, with OAuth2 service account authentication (domain-wide delegation) MAILER_DSN=gmail+api://SERVICE-ACCOUNT-EMAIL:BASE64-ENCODED-PRIVATE-KEY@default?user=USER-EMAIL
For the gmail+api transport:
SERVICE-ACCOUNT-EMAILis the service account e-mail address;BASE64-ENCODED-PRIVATE-KEYis the service account RSA private key (PEM), base64-encoded so that it fits in the DSN (base64_encode($pem));USER-EMAILis the address of the user to impersonate, which is also the address the messages are sent from: the Gmail API always sends as the authenticated user, so a custom envelope sender is not supported.
Envelope
The Gmail API takes the recipients from the message itself, it has no envelope field. The
envelope is therefore written into the headers of the message sent to Google: addresses it
drops are removed from To and Cc, and the ones it adds travel in Bcc, which Gmail
honors for delivery and strips from the delivered message. An envelope sender cannot be
expressed, Gmail always sends as the impersonated user.
Sponsor
This package is looking for a backer.
Help Symfony by sponsoring its development!