我正在尝试使用最新版本的PHPMailer从我的zoho帐户发送电子邮件。我不确定如何在PHPMailer中设置Zoho oAuth。它内置了对Google Yahoo和Microsoft的支持,但不支持Zoho。
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require '/path/PHPMailer/src/Exception.php';
require '/path/PHPMailer/src/PHPMailer.php';
require '/path/PHPMailer/src/OAuth.php';
require '/path/PHPMailer/src/SMTP.php';
$phpMailer = new PHPMailer(true);
$phpMailer->isSMTP();
$phpMailer->Host = "smtp.zoho.com";
$phpMailer->SMTPAuth = true;
$phpMailer->Username = "$USER";
$phpMailer->Password = "$PASS";
$phpMailer->SMTPSecure = "tls";
$phpMailer->Port = 587;
$phpMailer->isHTML(true);
$phpMailer->CharSet = "UTF-8";
$phpMailer->setFrom("$FROMMAIL", "$NAME");
$phpMailer->addAddress("$FROMMAIL");
$phpMailer->Subject = "$SUBJECT";
$phpMailer->Body = "$MESSAGE";
$phpMailer->send();
我不确定如何使用OAuth,还是必须使用:)请有人可以帮助我吗?