定制 pepijnsenders/swiftmailer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

pepijnsenders/swiftmailer

Composer 安装命令:

composer require pepijnsenders/swiftmailer

包简介

关键字:

README 文档

README

A Laravel Swift Mailer bundle, installable via the Artisan CLI:

php artisan bundle:install swiftmailer

You must then auto-load the bundle in bundles.php:

return array(
	'swiftmailer' => array('auto'=>true)
);

In your code, you need to get a Swift_Mailer instance:

$mailer = IoC::resolve('mailer');

You will also need a message instance that will allow you to construct your message and later send:

$message = Swift_Message::newInstance('Subject Of Email');

Ultimately the final code to construct a message will look something like this:

// If you do not want to auto-load the bundle, you can use this
Bundle::start('swiftmailer');

// Get the Swift Mailer instance
$mailer = IoC::resolve('mailer');

// Construct the message
$message = Swift_Message::newInstance('Message From Website')
	->setFrom(array('example@example.com'=>'Mr Example'))
	->setTo(array('example@example.com'=>'Mr Example'))
	->addPart('My Plain Text Message','text/plain')
	->setBody('<p>My HTML Message</p>','text/html');

// Send the email
$mailer->send($message);

Or, since your controllers have dynamic access to the IoC container:

$this->mailer->send($message);

Swift Mailer, by Chris Corbyn

Swift Mailer is a component based mailing solution for PHP 5. It is released under the LGPL license.

Swift Mailer is highly object-oriented by design and lends itself to use in complex web application with a great deal of flexibility.

For full details on usage, see the documentation.

IMPORTANT

Users upgrading from version 3.x or earlier absolutely MUST read the documentation. In short, the API is considerably different so your old code won't "just work".

Donations

If you'd like to make a donation, we are working on a system where donations are taken on a per-feature-request basis via the website with target amounts for each feature. In the meantime however you may donate directly to the author via PayPal:

PayPal: chris@w3style.co.uk

Donations are certainly voluntary, but seriously, you donors are complete legends and drive this project! :)

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 853
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL
  • 更新时间: 2013-09-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固