Я использую phpmailer для отправки электронной почты. Но сталкивайтесь с некоторыми проблемами.Почему функция phpmailer не работает
$mail = new PHPMailer();
//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.qq.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '100****@qq.com'; // SMTP username
$mail->Password = 'w******'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 465; // TCP port to connect to
$mail->setFrom('10****[email protected]', 'Mailer');
$mail->addAddress('1***[email protected]', 'Joe User'); // Add a recipient
$mail->addReplyTo('1*****[email protected]', 'Information');
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
он показывает сообщение не может быть отправлено.
Mailer Error: Extension missing: openssl
и я изменить php.ini ;extension=php_openssl.dll
к extension=php_openssl.dll
и он не может работать.
Я перезапускаю Apache, нет работы ... – a86356