Yii 1.1: yii-ses-smtp

Wraps the PHPmailer class into a Yii component. See https://bitbucket.org/hanski07/yii-ses for details.
4 followers

Setup

Please note that SES by Amazon must be setup on the server. Please see their setup instructions on how to do so.

  1. Put the SES directory in the extensions.
  2. Install phpmailer (I'd recommend composer)
  3. Go to the main.php (or wherever you want this component to be) and add the configuration:
imports(array(
    'application.extensions.SES.*',
 )),
 
components(
    array(
    'ses'=>array(
        'class' => 'SESComponent',
        'host' => "tls://email-smtp.us-east-1.amazonaws.com", //Amazon Server
        'username' => "xxxxxxxxxxxxxxxxxx",    //Enter Username from Amazon 
        'password' => "xxxxxxxxxxxxxxxxxxxx",  //Enter Pasword from Amazon 
        'port' => 465,                        //Port number from Amazon 
        'SMTPAuth' => true, 
        'from' => "xxx@xxxxxx.xxx",    //May be from any email you want 
        'fromName' => "xxxxxxxxxxxx", 
        'charSet' => "UTF-8", 
        'sender' => 'xxxxxx@xxxxxxx.xxx',  //Sender has to be verified email !!! 
        'errorEmailAddresses' => array(
            'xxx@xxxxx.comxx'=> "name1",
            '2@xxxx.com' => 'name2',
        ),
    ),
),

Usage

Yii::app()->ses->sendEmail("test@whatever.com","My first email","Hello World!");
Yii::app()->ses->sendEmails(
    array(
        "Name1" => "name@test.com", 
        "name2" => "name2@mycoolsite.com"
    ), "This is only a subject", "Body!");

Requirements

Yii 1.1 or above PHPMailer

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: kirkhansen
  • Category: Mail
  • Votes: +1
  • Downloaded: 0 times
  • Created on: Jul 1, 2014
  • Last updated: Jul 2, 2014
  • Tags: SES, AWS