All Projects → yiisoft → yii2-symfonymailer

yiisoft / yii2-symfonymailer

Licence: BSD-3-Clause license
Yii 2 Symfony mailer extension.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to yii2-symfonymailer

Yii2 Swiftmailer
Yii 2 swiftmailer extension.
Stars: ✭ 109 (+275.86%)
Mutual labels:  mail, yii2, mailer
django-yubin
Send e-mails asyncronously using cron
Stars: ✭ 44 (+51.72%)
Mutual labels:  mail, mailer
mailer
Generic mailer
Stars: ✭ 16 (-44.83%)
Mutual labels:  mail, mailer
Meteor-Mailer
📮 Bulletproof email queue on top of NodeMailer with support of multiple clusters and servers setup
Stars: ✭ 21 (-27.59%)
Mutual labels:  mail, mailer
Mail
📧 Handy email creation and transfer library for PHP with both text and MIME-compliant support.
Stars: ✭ 288 (+893.1%)
Mutual labels:  mail, mailer
mailing
📬 Sending emails with pleasure and prepared templates.
Stars: ✭ 15 (-48.28%)
Mutual labels:  mail, mailer
easymail
Easy way to install a mail server.
Stars: ✭ 60 (+106.9%)
Mutual labels:  mail, mailer
bulk-mail-cli
Do quick, hassle-free email marketing with this small but very powerful tool! 🔥
Stars: ✭ 88 (+203.45%)
Mutual labels:  mail, mailer
Mailer
A lightweight PHP SMTP mail sender
Stars: ✭ 53 (+82.76%)
Mutual labels:  mail, mailer
yii2-mailqueue
Yii2 mail queue component for yii2-swiftmailer.
Stars: ✭ 15 (-48.28%)
Mutual labels:  mail, yii2
yii2-admin-theme
基于Yii2+layui的后台框架模板,实现了完善的RBAC权限控制
Stars: ✭ 87 (+200%)
Mutual labels:  yii2
rb-sisimai
Mail Analyzing Interface for email bounce: A Ruby library to parse RFC5322 bounce mails and generating structured data as JSON from parsed results. Ruby version of Sisimai: an error mail analyzer.
Stars: ✭ 78 (+168.97%)
Mutual labels:  mail
yii2-translatable
Translatable behavior aggregates logic of linking translations to the primary model
Stars: ✭ 15 (-48.28%)
Mutual labels:  yii2
yii2-basic-adminlte3
Yii 2 + AdminLTE 3 (Bootstrap 4) Yii2 Basic Project Template Build on AssetBundle (No CDN/Import CSS,JS Files)
Stars: ✭ 24 (-17.24%)
Mutual labels:  yii2
yii2-lets-talk
With this extension you can open chat with someone in popular messengers using the link on your website.
Stars: ✭ 15 (-48.28%)
Mutual labels:  yii2
yii2-queue-monitor
Yii2 Queue Analytics Module
Stars: ✭ 99 (+241.38%)
Mutual labels:  yii2
gromox
Groupware server backend for the grommunio Distribution, supporting MAPI/HTTP, RPC/HTTP, IMAP, POP3 protocols, PHP-MAPI bindings, and import from PST/OST/MSG/TNEF, EML/ICAL/VCF, KDB
Stars: ✭ 163 (+462.07%)
Mutual labels:  mail
install
basic script for project installation
Stars: ✭ 17 (-41.38%)
Mutual labels:  yii2
Tmail
Golang SMTP server
Stars: ✭ 251 (+765.52%)
Mutual labels:  mail
enough mail
IMAP, POP3 and SMTP clients for Dart developers. Contains both low level as well as a high level API.
Stars: ✭ 78 (+168.97%)
Mutual labels:  mail

Yii Mailer Library - Symfony Mailer Extension


This extension provides a Symfony Mailer mail solution for Yii framework 2.0.

For license information check the LICENSE-file.

Latest Stable Version Total Downloads Build Status

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yiisoft/yii2-symfonymailer

or add

"yiisoft/yii2-symfonymailer": "~3.0.0"

to the require section of your composer.json.

Usage

To use this extension, simply add the following code in your application configuration:

return [
    //....
    'components' => [
        'mailer' => [
            'class' => \yii\symfonymailer\Mailer::class,            
            'transport' => [
                'scheme' => 'smtps',
                'host' => '',
                'username' => '',
                'password' => '',
                'port' => 465,
                'dsn' => 'native://default',
            ],
            'viewPath' => '@common/mail',
            // send all mails to a file by default. You have to set
            // 'useFileTransport' to false and configure transport
            // for the mailer to send real emails.
            'useFileTransport' => false,
        ],
    ],
];

or

return [
    //....
    'components' => [
        'mailer' => [
            'class' => \yii\symfonymailer\Mailer::class,            
            'transport' => [
                'dsn' => 'smtp://user:[email protected]:25',
            ],
        ],
    ],
];

You can then send an email as follows:

Yii::$app->mailer->compose('contact/html')
     ->setFrom('[email protected]')
     ->setTo($form->email)
     ->setSubject($form->subject)
     ->send();

Migrating from yiisoft/yii2-swiftmailer

To migrate from the deprecated yiisoft/yii2-swiftmailer to this extension you need to update the application config.

Swiftmailer default transport was the SendmailTransport, while this extension will default to a NullTransport (sends no mail). You can use the swiftmailer default like the following:

'mailer' => [
    'class' => yii\symfonymailer\Mailer::class,
    'transport' => [
        'dsn' => 'sendmail://default',
    ],
],

Security implications of the DSN

While the DSN might seem like a simple way to allow user configurable mailer settings it should be noted that the sendmail transport allows for execution of local executables. If you need to have a user configurable DSN (which is easier to build and more powerful to use than creating a GUI) you should probably disable the sendmail transport. Any user who has the power to configure a DSN essentially has shell access to wherever the code is running.

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].