我正在使用 yii 框架开发邮件发送功能。我正在使用链接=“http://www.yiiframework.com/extension/mailer”上给出的邮件扩展。我已经在扩展文件夹中添加了所有文件。我已经用代码制作了单独的类文件 -
public function sendEmail($FromEmail,$ToEmail,$Subject,$Message)
{
$settings=new Settings();
$mailer = Yii::createComponent('application.extensions.mailer.EMailer');
$mailer->IsSMTP();
$mailer->IsHTML(true);
$mailer->SMTPAuth = true;
$mailer->SMTPSecure = 'ssl';
$mailer->Host =$settings->Host;
$mailer->Port =$settings->Port;
$mailer->CharSet = 'UTF-8';
$mailer->Username =$FromEmail;
$mailer->Password ='';
$mailer->FromName = 'feedback@balaee.com';
$mailer->AddAddress($ToEmail);
$mailer->Subject = $Subject;
$mailer->IsHTML(true);
$mailer->Body=$Message;
if($mailer->Send())
{
echo "Mail send Successfully.Please you have check mail ";
}
else
{
echo "Fail to send your message!";
}
}
所以它工作正常。它根据需要发送电子邮件。但我想在使用它时包含“cc”和“bcc”参数以维护安全性。那么如何使用邮件扩展程序使用“cc”和“bcc”?