sudheesh001 / email
电子邮件助手类,使用Swiftmailer。已删除的Shadowhand/email的副本
dev-master
2017-03-08 05:19 UTC
Requires
- php: >=5.3.0
- kohana/core: 3.3.*
- swiftmailer/swiftmailer: ~4.3.1
This package is not auto-updated.
Last update: 2024-09-29 01:22:48 UTC
README
基于工厂的电子邮件类。该类是Swiftmailer的简单包装。
使用方法
使用 Email::factory($subject, $message) 方法创建新消息。添加收件人、添加发件人、发送消息
$email = Email::factory('Hello, World', 'This is my body, it is nice.')
->to('person@example.com')
->from('you@example.com', 'My Name')
->send()
;
您还可以在消息中添加HTML
$email->message('<p>This is <em>my</em> body, it is <strong>nice</strong>.</p>', 'text/html');
可以使用 to()、cc() 和 bcc() 方法添加额外收件人。
可以使用 from() 和 reply_to() 方法添加额外发件人。如果指定了多个发件人地址,您需要使用 sender() 方法设置实际的消息发件人。使用 return_path() 方法设置退回收件人。
要直接访问和修改 Swiftmailer消息,请使用 raw_message() 方法。
配置
配置存储在 config/email.php 中。选项取决于所使用的传输方法。请参阅Swiftmailer文档了解每个传输方法可用的选项。