Coder Social home page Coder Social logo

omnismtp's Introduction

OmniSmtp

Framework agnostic SMTP processing library for PHP

Usage

<?php

$sendinblue = \OmniSmtp\OmniSmtp::create(\OmniSmtp\SendInBlue::class, 'test-api-key');

$sendinblue->setSubject('The Mail Subject')
           ->setFrom('[email protected]')
           ->setRecipients('[email protected]', '[email protected]')
           ->setContent('<p>Hello From SendInBlue OmniSmtp</p>')
           ->send();

Drivers

All mail providers must implement \OmniSmtp\Common\ProviderInterface, and will usually extend \OmniSmtp\Common\AbstractProvider for basic functionality.


The following drivers are available:

Driver 3.x Composer Package Maintainer Installation
sendinblue omnismtp/sendinblue Jeff Claud composer require omnismtp/sendinblue
sendgrid napoleon/omnismtp-sendgrid Napoleon Cariño composer require napoleon/omnismtp-sendgrid

Driver method

The main method implemented by drivers are:

  • getAuthorizationHeaderName() - smtp provider authorization header name. Usually Authorization.
  • getSmtpEndpoint() - web api endpoint of smtp providers.

Optional setter methods you may want to implement:

  • setFrom(string $email) - Email of the sender.
  • setRecipients(...$recipients) - List of recipients email.
  • setContent(string $html) - Email html content.

Note: When implementing these setter methods in your own, you may call setData($key, $value) to set your data. Ex.

<?php
public function setFrom(string $email)
{
     return $this->setData(self::FROM, $email);
}

omnismtp's People

Contributors

crazymeeks avatar napoleon101392 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.