安装最新版Swoole,开启一键协程化,使用原版phpmailer就可以实现协程化了。本项目已经没有维护下去的意义。
LGPL-2.1 License
Swoole PHPMailer
PHPMailer 6.0 PHPMailer Swoole PHPMailer PHPMailer 6.0
Composer PHPMailer Swoole
QQ17916227
Composer:"yurunsoft/phpmailer-swoole":"~1.0"
PHPMailer Swoole
go(function(){
$mail = new PHPMailer; //PHPMailer
$mail->CharSet = 'UTF-8'; //ISO-8859-1
$mail->IsSMTP(); // SMTP
$mail->SMTPDebug = 0; // SMTP
$mail->SMTPAuth = true; // SMTP
$mail->SMTPSecure = 'ssl'; //
$mail->Host = 'smtp.163.com'; // SMTP
$mail->Port = '994'; // SMTP
$mail->Username = ''; // SMTP
$mail->Password = ''; // SMTP
$mail->SetFrom('', ''); //
$mail->Subject = 'title test';
$mail->MsgHTML('hello world');
$mail->AddAddress(''); //
$result = $mail->Send();
if($result)
{
var_dump('ok');
}
else
{
$result = $error = $mail->ErrorInfo;
var_dump($result);
}
});
test