CApplicationComponent | --YiiMail
Located in File: /YiiMail.php
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);
This differs from send() in the way headers are presented to the recipient. The only recipient in the "To:" field will be the individual recipient it was sent to.
If an iterator is provided, recipients will be read from the iterator one-by-one, otherwise recipient data will be retreived from the YiiMailMessage object.
Sender information is always read from the YiiMailMessage object.
The return value is the number of recipients who were accepted for delivery.
not been created yet
All recipients (with the exception of Bcc) will be able to see the other recipients this message was sent to.
If you need to send to each recipient without disclosing details about the other recipients see batchSend().
Recipient/sender data will be retreived from the YiiMailMessage object.
The return value is the number of recipients who were accepted for delivery.