leoflapper/mailprovider 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

leoflapper/mailprovider

Composer 安装命令:

composer require leoflapper/mailprovider

包简介

Allows you to quickly send mails with different mail services like PHPMailer, Mandrill, SendGrind and Mailgun

README 文档

README

MailProvider allows you to quickly send mails with PHPMailer or different mail services like Mandrill, SendGrind or Mailgun.

Usage

The MailProvider allows you to compose an email in a single format. You only have to choose the desired service.

PHPMailer

    $service = new MailProvider\Service\PHPMailer();
    $service
        ->setProtocol('smtp')
        ->setHost('localhost')
        ->setPort(1025)
        ->addTo('info@myemail.nl', 'Leo Flapper')
        ->addCc('cc@myemail.nl', 'Leo Flapper')
        ->addBcc('bcc@myemail.nl', 'Leo Flapper')
        ->setFrom('info@myhost.nl', 'Leo Flapper')
        ->setSubject('My Subject')
        ->setHtml('<p>Beautiful content</p>')
        ->addAttachment('../LICENSE.md', 'Attachment.txt')
        ->addHeader('MyHeader', 'Value')
        ->setReplyTo('reply@myemail.nl');

    $service->send();

Other mail services

    //$service = new MailProvider\Service\SendGrid('API-KEY');
    //$service = new MailProvider\Service\Mailgun('API-KEY');
    $service = new MailProvider\Service\Mandrill('API-KEY');
    $service
        ->addTo('info@myemail.nl', 'Leo Flapper')
        ->addCc('cc@myemail.nl', 'Leo Flapper')
        ->addBcc('bcc@myemail.nl', 'Leo Flapper')
        ->setFrom('info@myhost.nl', 'Leo Flapper')
        ->setSubject('My Subject')
        ->setText('My text')
        ->setHtml('<p>Beautiful content</p>')
        ->addAttachment('../LICENSE.md', 'Attachment.txt')
        ->addHeader('MyHeader', 'Value')
        ->setReplyTo('reply@myemail.nl');
    $service->send();

Installation

Add MailProvider to your composer.json file. If you are not using Composer, you should be. It's an excellent way to manage dependencies in your PHP application.

{  
  "require": {
    "leoflapper/mailprovider": "dev-master"
  }
}

Then at the top of your PHP script require the autoloader:

require 'vendor/autoload.php';

Example

There are different examples located inside the examples directory.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 1.54k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固