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>'
);
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.