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

Setup

  1. Requirements
  2. Resources

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

  1. Requirements
  2. Resources
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

0 0
3 followers
0 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Mail
Tags: AWS, ses
Developed by: kirkhansen
Created on: Jul 1, 2014
Last updated: 3 years ago

Related Extensions