PHPackages                             sptec/gmail-api-mailer-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. sptec/gmail-api-mailer-bundle

ActiveSymfony-bundle[Mail &amp; Notifications](/categories/mail)

sptec/gmail-api-mailer-bundle
=============================

Symfony Mailer Transport for Gmail API including Google OAuth2 authentication.

4239↓100%2PHP

Since Oct 14Pushed 3y ago1 watchersCompare

[ Source](https://github.com/stefanpoensgen/SptecGmailApiMailerBundle)[ Packagist](https://packagist.org/packages/sptec/gmail-api-mailer-bundle)[ RSS](/packages/sptec-gmail-api-mailer-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Gmail Api Mailer Bundle
=======================

[](#gmail-api-mailer-bundle)

Symfony Mailer Transport for Gmail API including Google OAuth2 authentication.

Requirements
------------

[](#requirements)

- Symfony &gt;= 5.4

Installation
------------

[](#installation)

#### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Use [Composer](http://getcomposer.org/) to install this bundle:

```
composer require sptec/gmail-api-mailer-bundle

```

#### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

```
// config/bundles.php

return [
    // ...
    Sptec\GmailApiMailerBundle\SptecGmailApiMailerBundle => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

### Google API Client

[](#google-api-client)

If you don't use [Symfony Flex](https://github.com/symfony/flex) you have create the following configuration

```
# config/packages/google_apiclient.yaml
services:
  Google_Client:
    class: Google_Client
    calls:
      - [setClientId, ['%env(GOOGLE_CLIENT_ID)%']]
      - [setClientSecret, ['%env(GOOGLE_CLIENT_SECRET)%']]
```

### .env

[](#env)

```
###> google/apiclient ###
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
###< google/apiclient ###

###> symfony/mailer ###
MAILER_DSN=gmail+api://null
###< symfony/mailer ###
```

Usage
-----

[](#usage)

```
bin/console sptec:google:auth

```

Your Google access token will be stored as json environment variable `GOOGLE_ACCESS_TOKEN`by using [Symfony's secrets management system](https://symfony.com/doc/current/configuration/secrets.html).

Google Credentials
------------------

[](#google-credentials)

1. Open the [Google Cloud console](https://console.cloud.google.com/).
2. At the top-left, click Menu menu &gt; APIs &amp; Services &gt; Credentials.
3. Click Create Credentials &gt; OAuth client ID.
4. Click Application type &gt; Web application.
5. Enter a name for the OAuth client ID. (e.g. Symfony Gmail API Mailer)
6. Add authorized redirect URIs. (default: )
7. Click Create.

###  Health Score

19

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d1eeb5ec3f6a60183d8df4cc17b3bc5911bbcb7a83c32eba451eefdd092ed9c0?d=identicon)[stefanpoensgen](/maintainers/stefanpoensgen)

---

Top Contributors

[![stefanpoensgen](https://avatars.githubusercontent.com/u/22468102?v=4)](https://github.com/stefanpoensgen "stefanpoensgen (5 commits)")

---

Tags

gmail-apigoogle-apihacktoberfestsymfonysymfony-bundle

### Embed Badge

![Health badge](/badges/sptec-gmail-api-mailer-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/sptec-gmail-api-mailer-bundle/health.svg)](https://phpackages.com/packages/sptec-gmail-api-mailer-bundle)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k494.8M201](/packages/tijsverkoyen-css-to-inline-styles)[symfony/mailer

Helps sending emails

1.6k355.7M770](/packages/symfony-mailer)[sendgrid/sendgrid

This library allows you to quickly and easily send emails through Twilio SendGrid using PHP.

1.5k46.4M151](/packages/sendgrid-sendgrid)[minishlink/web-push

Web Push library for PHP

1.9k11.4M42](/packages/minishlink-web-push)[pelago/emogrifier

Converts CSS styles into inline style attributes in your HTML code

94843.3M89](/packages/pelago-emogrifier)[thomasjohnkane/snooze

Schedule future notifications and reminders in Laravel

9071.5M2](/packages/thomasjohnkane-snooze)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
