php 发邮件 Email

PHPMailer 的官方网站https://github.com/Synchro/PHPMailer/commit/9103c12ef029550961e1b69e2a5053b95a2a8246


<?php

public function actionemail($AddAddress,$Subject,$Body,$Call){


//$AddAddress 接收者邮箱

//$Subject    邮件标题

//$Body       邮件内容

//$Call       接收者称呼


$mail = Yii::createComponent('application.extensions.mailer.EMailer');

$mail->Host = 'smtp.exmail.qq.com';

$mail->IsSMTP();

$mail->Host = 'smtp.exmail.qq.com';

$mail->SMTPAuth = true;

$mail->CharSet = 'UTF-8';

$mail->setLanguage('zh_cn');

$mail->Username = ''; //账号

$mail->Password = ''; //密码

$mail->From = '';     //账号

$mail->FromName = ''; //发送人昵称

$mail->AddAddress($AddAddress,$Call);

$mail->Subject = $Subject;

$mail->Body    = $Body;

$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

echo $mail->Send() ? true : false ;

}

?>


你可能感兴趣的:(PHP,email)