Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/genietim/msft-graph-mailer
A mailer for Symfony to send mails using Microsoft Graph (i.e., send Office 365/Outlook/Exchange E-Mails)
https://github.com/genietim/msft-graph-mailer
Last synced: 3 days ago
JSON representation
A mailer for Symfony to send mails using Microsoft Graph (i.e., send Office 365/Outlook/Exchange E-Mails)
- Host: GitHub
- URL: https://github.com/genietim/msft-graph-mailer
- Owner: GenieTim
- License: mit
- Created: 2024-01-28T16:13:17.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-23T20:37:30.000Z (9 months ago)
- Last Synced: 2024-05-01T15:17:09.583Z (6 months ago)
- Language: PHP
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# msft-graph-mailer
A mailer for Symfony to send mails using Microsoft Graph (i.e., send Office 365/Outlook/Exchange E-Mails)
## Installation
Simply install using Composer:
```bash
composer require bernhardwebstudio/msft-graph-mailer
```## Configuration
You need to tell Symfony that this is a mail transport:
```yaml
# services.yaml
services:
mailer.transport_factory.msftgraph:
class: BernhardWebstudio\Mailer\Bridge\MsftGraphMailer\Transport\MsftGraphTransportFactory
parent: mailer.transport_factory.abstract
tags:
- { name: "mailer.transport_factory" }
```Finally, you need to configure the mailer bundle to use this transport,
e.g. using an ENV variable like```bash
MAILER_DSN=msft+graph://{client-id}:{client-secret}@outlook.com?saveToSent=1&tenant={tenant-id}
```where you replace all the values in `{}` with your own values from your active directory.
The `tenant` and `saveToSent` options are optional.
## Usage
If you set the configuration correctly, that's all, you can simply use the Symfony mailer
and you will be sending the E-Mails using the Microsoft Graph API.Please note that this transport does not support all types of E-Mail messages in its best form.
Please contribute if you understand enough about MIME and Microsoft Graph to fix this.Additionally, Microsoft imposes restrictions on the sender E-Mail you can use.
Simply be aware of that when setting the `From` of the E-Mail, please, if you want to prevent errors.