Код: Выделить всё
$SM = Yii::app()->swiftMailer;
$Transport = $SM->smtpTransport($HostEmailIntermedia, 25);
// Mailer
$Mailer = $SM->mailer($Transport);
$message = Yii::app()->controller->renderPartial('application.views.email.layouts.common', array('content'=>'application.views.email.registration'), true, false);
// New message
$Message = $SM
->newMessage('My subject')
->setFrom(array($adminEmail => 'Example Name'))
->setTo(array($email => 'Recipient Name'))
->addPart($message, 'text/html')
->setBody($message);
// Send mail
$Mailer->send($Message);