Download the PHP package holmessohe/graph-mail without Composer
On this page you can find all versions of the php package holmessohe/graph-mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download holmessohe/graph-mail
More information about holmessohe/graph-mail
Files in holmessohe/graph-mail
Download holmessohe/graph-mail
More information about holmessohe/graph-mail
Files in holmessohe/graph-mail
Vendor holmessohe
Package graph-mail
Short Description Send emails via Microsoft Graph API for laravel
License MIT
Package graph-mail
Short Description Send emails via Microsoft Graph API for laravel
License MIT
Please rate this library. Is it a good library?
Informations about the package graph-mail
holmessohe/graph-mail
Package Laravel pour envoyer des emails via Microsoft Graph API (Office 365 / Azure AD).
Prérequis
- PHP 8.0+
- Laravel 9, 10 ou 11
- Un compte Microsoft Azure avec une application enregistrée
Installation
Configuration
1. Publier la configuration
Cela va créer le fichier config/graph-mail.php dans ton projet.
2. Ajouter les variables dans .env
3. Où trouver ces valeurs ?
- Va sur portal.azure.com
- App registrations → sélectionne ton application
MICROSOFT_TENANT_ID→ Directory (tenant) IDMICROSOFT_CLIENT_ID→ Application (client) IDMICROSOFT_CLIENT_SECRET→ Certificates & secrets → New client secretMICROSOFT_SENDER_EMAIL→ L'adresse email qui va envoyer les mails
Utilisation
Envoi simple
Envoi avec une vue Blade
Envoi avec pièce jointe (PDF)
⚠️ La pièce jointe doit faire moins de 3 Mo.
Envoi à plusieurs destinataires
Utilisation dans un Controller
Injection de dépendance (recommandé)
Gestion des erreurs
Le package lance une exception RuntimeException si l'envoi échoue.
Il est recommandé de l'attraper :
Méthodes disponibles
sendMail()
| Paramètre | Type | Obligatoire | Description |
|---|---|---|---|
$to |
string |
✅ | Email du destinataire |
$subject |
string |
✅ | Sujet de l'email |
$htmlBody |
string |
✅ | Contenu HTML de l'email |
$attachmentPath |
string\|null |
❌ | Chemin vers la pièce jointe |
$attachmentName |
string\|null |
❌ | Nom de la pièce jointe |
getAccessToken()
Récupère et met en cache le token OAuth2 pendant 55 minutes. Tu n'as normalement pas besoin d'appeler cette méthode directement.
Licence
MIT — Holmès SOHE
All versions of graph-mail with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.0
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/http Version ^9.0|^10.0|^11.0
laravel/helpers Version ^1.8
illuminate/support Version ^9.0|^10.0|^11.0
illuminate/http Version ^9.0|^10.0|^11.0
laravel/helpers Version ^1.8
The package holmessohe/graph-mail contains the following files
Loading the files please wait ...