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

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
0
Yii Version: 1.1
License: BSD-2-Clause
Category: Mail
Developed by: kirkhansen kirkhansen
Created: Jul 1, 2014
Updated: 12 years ago

Related Extensions