prasanth-gandiva/yii2-yashop-ses
最新稳定版本:v1.0.2
Composer 安装命令:
composer require prasanth-gandiva/yii2-yashop-ses
包简介
Extension for sending emails via amazon ses
关键字:
README 文档
README
Extension for sending emails via amazon ses. Part of YaShop
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist prasanth-gandiva/yii2-yashop-ses "*"
or add
"prasanth-gandiva/yii2-yashop-ses": "*"
to the require section of your composer.json file.
Usage
To use this extension, you should configure it in the application configuration like the following:
'components' => [ ... 'mail' => [ 'class' => 'yashop\ses\Mailer', 'access_key' => 'Your access key', 'secret_key' => 'Your secret key', 'host' => 'email.us-east-1.amazonaws.com' // not required ], ... ],
To send an email, you may use the following code:
Yii::$app->mail->compose('contact/html', ['contactForm' => $form]) ->setFrom('from@domain.com') ->setTo($form->email) ->setSubject($form->subject) ->send();
To send an email with attachment file url, you may use the following code:
$file = "www.example.com/file/demo.csv"; Yii::$app->mail->compose('contact/html', ['contactForm' => $form]) ->setFrom('from@domain.com') ->setTo($form->email) ->setSubject($form->subject) ->attach($file) ->send();
统计信息
- 总下载量: 30k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-19