Skip to content

adbrosaci/nette-microsoft-mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nette Microsoft Mailer

This library provides e-mail sending via Microsoft Graph API.


main workflow Licence Downloads this Month Downloads total Latest stable

How to install

composer require adbros/nette-microsoft-mailer

Register mailer

Just rewrite the default mailer service in your neon file.

services:
	mail.mailer: Adbros\MicrosoftMailer\MicrosoftMailer(
		tenantId: 'tenant_id'
		clientId: 'client_id'
		clientSecret: 'client_secret'
		defaultSender: 'default_sender_email'
	)

Usage

Use as standard Nette Mailer.

<?php

use Nette\Mail\Mailer;
use Nette\Mail\Message;

class SomeClass
{

    public function __construct(
        private Mailer $mailer,
    ) 
    {    
    }
    
    public function sendEmail(): void
    {
        $message = new Message();
        $message->setSubject('Hello World!');
        $message->setHtmlBody('<h1>Hello World!</h1>');
        $message->addTo('[email protected]');
        
        $this->mailer->send($message);
    }
    
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages