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 1mo ago

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 10% 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.8k505.3M228](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M52](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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