pear-mail One simple mail extension for Yii framework

  1. Resources
  2. Installation
  3. Usage

It uses PEAR Mail (not bundled) and for now only includes Mailer component that allows to send plain text and MIME mails. In near future this component could permit Cc, Bcc and Reply-to settings, file attachments and so on. Put messages on a queue for later delivery is also planned.

Resources

Installation

  • Install PEAR Mail and PEAR Mail_Mime.

  • Unpack mail extension under your extensions directory.

  • Configure Mailer component (see PHPDoc):

'mailer'=>array(
		'class'=>'ext.mail.Mailer',
		'backend'=>'...',
		'backendParams'=>array(
			...
		),
		'mimeParams'=>array(
			...
		),
	),

Usage

  • Send a plain text mail:
Yii::app()->mailer->send(
	'from@example.com',
	array(
		'to1@example.com',
		'to2@example.com',
	),
	'Subject',
	'This is the body'
);
  • Send a MIME mail:
Yii::app()->mailer->sendMIME(
	'from@example.com',
	array(
		'to1@example.com',
		'to2@example.com',
	),
	'Subject',
	'This is the plain text body'
	'<html><body>This is the HTML body</body></html>'
);
1 0
2 followers
594 downloads
Yii Version: 1.1
License: LGPL-3.0
Category: Mail
Tags: mail, pear
Created on: Jan 22, 2013
Last updated: 11 years ago

Downloads

show all

Related Extensions