Git Product home page Git Product logo

yii-swiftmailer's Introduction

This is basically updated wrapper of SwiftMailer which can be used as application component.

##Installation

  1. Unzip extension contents to protected/extensions/ folder
  2. Set up yii component via config:
'mailer' => array(
	'class' => 'path.to.swiftMailer.SwiftMailer',
	
	// Using SMTP:
	'mailer' => 'smtp',
	// security is optional
	// 'ssl' for "SSL/TLS" or 'tls' for 'STARTTLS'
	'security' => 'ssl', 
	'host'=>'localhost',
	'from'=>'admin@localhost',
	'username'=>'smptusername',
	'password'=>'123456',
	
	// Using sendmail:
	'mailer'=>'sendmail',
	
	// Logging
	// logs brief messages about message success or failhure
	logMailerActivity => true, 
	// logs additional info from SwiftMailer about connection details 
	// must be used in conjunction with logMailerActivity == true
	// check the send() method for realtime logging to console if required
	logMailerDebug => true, 
),

##Usage

Yii::app()->mailer->addAddress($email);
Yii::app()->mailer->subject("Let's do this!");
Yii::app()->mailer->msgHTML("<a href='http://site.com'>test</a>");
Yii::app()->mailer->send();

or

Yii::app()->mailer->addAddress($email)
	->subject("Let's do this!")
	->msgHTML("<a href='http://site.com'>test</a>")
	->send();

Add file:

app()->mailer
    ->addAddress($email){"cmd":"emailRegistration","params":{"id":"7"}}
    ->msgHTML('<p>You received an invoice!</p>')
    ->addFile($filepath)
    ->send();

Please, take a look a SwiftMailer::send() function

##Resources

yii-swiftmailer's People

Contributors

asfdfdfd avatar circulon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.