Description
CApplicationComponent
|
--YiiMail
Located in File: /YiiMail.php
YiiMail is an application component used for sending email.
You may configure it as below. Check the public attributes and setter methods of this class for more options.
return array(
...
'import => array(
...
'ext.mail.YiiMailMessage',
),
'components' => array(
'mail' => array(
'class' => 'ext.yii-mail.YiiMail',
'transportType' => 'php',
'viewPath' => 'application.views.mail',
'logging' => true,
'dryRun' => false
),
...
)
);
Example usage:
$message = new YiiMailMessage;
$message->setBody('Message content here with HTML', 'text/html');
$message->subject = 'My Subject';
$message->addTo('johnDoe@domain.com');
$message->from = Yii::app()->params['adminEmail'];
Yii::app()->mail->send($message);