All Projects β†’ Webador β†’ SlmMail

Webador / SlmMail

Licence: other
Send mail from Laminas or Mezzio using external mail services.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to SlmMail

wemail
Send Affordable Bulk Email Campaign Through WordPress
Stars: ✭ 19 (-82.24%)
Mutual labels:  mailgun, postmark, sendgrid, sparkpost, amazon-ses
go-mail
πŸ“§ A cross platform mail driver for GoLang. Featuring Mailgun, Postal, Postmark, SendGrid, SparkPost & SMTP.
Stars: ✭ 169 (+57.94%)
Mutual labels:  mail, mailgun, postmark, sendgrid, sparkpost
MailHookBundle
A bundle to catch API webhook from different mail service
Stars: ✭ 36 (-66.36%)
Mutual labels:  mandrill, mailgun, sendgrid, sparkpost
Laravel Mailbox
Catch incoming emails in your Laravel application
Stars: ✭ 783 (+631.78%)
Mutual labels:  mail, mailgun, sendgrid
Email Templates
πŸ“« Create, preview, and send custom email templates for Node.js. Highly configurable and supports automatic inline CSS, stylesheets, embedded images and fonts, and much more!
Stars: ✭ 3,291 (+2975.7%)
Mutual labels:  mandrill, postmark, sendgrid
mailcoach-support
Questions and support for Mailcoach
Stars: ✭ 32 (-70.09%)
Mutual labels:  mailgun, sendgrid, amazon-ses
Slmmail
Send mail from Laminas or Mezzio using external mail services.
Stars: ✭ 106 (-0.93%)
Mutual labels:  mail, mailgun, sendgrid
go-mail
πŸ“¨ Simple email interface across multiple service providers (ses, postmark, mandrill, smtp)
Stars: ✭ 39 (-63.55%)
Mutual labels:  mail, mandrill, postmark
swiftmailer-postmark
The Official Swiftmailer Transport for Postmark.
Stars: ✭ 52 (-51.4%)
Mutual labels:  mail, postmark
bulk-mail-cli
Do quick, hassle-free email marketing with this small but very powerful tool! πŸ”₯
Stars: ✭ 88 (-17.76%)
Mutual labels:  mail, mailgun
mailer
Simple Email Sending Client for Mailgun & Sendgrid services in crystal
Stars: ✭ 16 (-85.05%)
Mutual labels:  mailgun, sendgrid
zend-di-config
PSR-11 PHP-DI container configurator for Laminas, Mezzio, ZF, Expressive applications or any framework that needs a PSR-11 container
Stars: ✭ 19 (-82.24%)
Mutual labels:  laminas, mezzio
keystone-email
⚠️ Archived - Legacy email helper for KeystoneJS Apps
Stars: ✭ 30 (-71.96%)
Mutual labels:  mandrill, mailgun
laminas-dependency-plugin
Replace zendframework and zfcampus packages with their Laminas Project equivalents.
Stars: ✭ 32 (-70.09%)
Mutual labels:  laminas, mezzio
SlmQueue
Laminas / Mezzio module that integrates with various queue management systems.
Stars: ✭ 135 (+26.17%)
Mutual labels:  laminas, mezzio
ApigilityConsumer
πŸƒ Zend Framework/Laminas and Expressive/Mezzio Apigility/Laminas API Tools Client Module to consume API Services
Stars: ✭ 15 (-85.98%)
Mutual labels:  laminas, mezzio
postmark-wordpress
The Official Postmark Wordpress Plugin
Stars: ✭ 17 (-84.11%)
Mutual labels:  mail, postmark
Fluentemail
All in one email sender for .NET. Supports popular senders (SendGrid, MailGun, etc) and Razor templates.
Stars: ✭ 1,888 (+1664.49%)
Mutual labels:  mailgun, sendgrid
Mailer
A light-weight, modular, message representation and mail delivery framework for Python.
Stars: ✭ 225 (+110.28%)
Mutual labels:  mailgun, sendgrid
ErrorHeroModule
πŸ’Ž A Hero for your Zend Framework/Laminas, and Expressive/Mezzio application to log ( DB and Mail ) and handle php errors & exceptions during Mvc process/between request and response
Stars: ✭ 47 (-56.07%)
Mutual labels:  laminas, mezzio

SlmMail

Build Status Latest Stable Version Scrutinizer Code Quality

SlmMail is a module that integrates with various third-parties API to send mails. Integration is provided with the API of those services. It does not handle SMTP.

Here are the currently supported services:

Installation

  1. First install the repo:

    composer require slm/mail

    • For Laminas MVC add SlmMail in your application.config.php file.
    • For Mezzio it should prompt whether we want to autoconfigure. Accept this.
  2. In order to use a mail service, you now need to configure it. We have provided a sample configuration file per mail server.

    Copy the sample configuration file to your autoload directory. For example for Mandrill one would use

    cp vendor/slm/mail/config/slm_mail.mandrill.local.php.dist config/autoload/slm_mail.mandrill.local.php

    Please tweak the dummy contents in this file. This file will contain the credentials.

Usage

One can now fetch the dependencies from the service manager. And now compose a message:

$message = new \Laminas\Mail\Message();
$message
    ->setTo('send@to')
    ->setFrom('send@by')
    ->setSubject('Subject')
    ->setBody('Contents');

$mandrillService = $container->get(\SlmMail\Service\MandrillService::class);
$mandrillService->send($message);

Documentation

Documentation for SlmMail is splitted for each provider:

Cook-book

How to send an HTML email ?

Every email providers used in SlmMail allow to send HTML emails. However, by default, if you set the mail's content using the setBody content, this content will be considered as the plain text version as shown below:

$message = new \Laminas\Mail\Message();

// This will be considered as plain text message, even if the string is valid HTML code
$message->setBody('Hello world');

To send a HTML version, you must specify the body as a MimeMessage, and add the HTML version as a MIME part, as shown below:

$message = new \Laminas\Mail\Message();

$htmlPart = new \Laminas\Mime\Part('<html><body><h1>Hello world</h1></body></html>');
$htmlPart->type = "text/html";

$textPart = new \Laminas\Mime\Part('Hello world');
$textPart->type = "text/plain";

$body = new \Laminas\Mime\Message();
$body->setParts(array($textPart, $htmlPart));

$message->setBody($body);

For accessibility purposes, you should always provide both a text and HTML version of your mails.

How to configure HttpClient with http_options and http_adapter

By default the adapter is Laminas\Http\Client\Adapter\Socket but you can override it with other adapter like this in your slm_mail.*.local.php

'slm_mail' => array(
    // Here your email service provider options

    'http_adapter' => 'Laminas\Http\Client\Adapter\Proxy' // for example
)

If you want to change some options of your adapter please refer to you adapter class in var $config here and override these in your slm_mail.*.local.php like this :

'slm_mail' => array(
    // Here your email service provider options

    // example for Socket adapter
    'http_options' => array(
        'sslverifypeer' => false,
        'persistent' => true,
    ),
)

Which provider should I choose?

We won't answer you :-)! Each provider has their own set of features. You should carefully read each website to discover which one suits your needs best.

Who to thank?

Jurian Sluiman and MichaΓ«l Gallego did the initial work on creating this repo, and maintained it for a long time.

Currently it is maintained by:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].