Answer the question
In order to leave comments, you need to log in
Timeout when sending message via SMTP using PHPMailer?
There is a code:
$mail = new PHPMailer;
$mail->CharSet = 'UTF-8';
// Настройки SMTP
$mail->isSMTP();
$mail->SMTPAuth = true;
$mail->SMTPDebug = 3;
$mail->Host = 'smtp.yandex.com';
$mail->Port = 465;
$mail->Username = '***@yandex.ru';
$mail->Password = '***';
// От кого
$mail->setFrom('***[email protected]', 'Snipp.ru');
// Кому
$mail->addAddress('[email protected]', 'Иван Петров');
// Тема письма
$mail->Subject = "Тема";
// Тело письма
$body = '<p><strong>«Hello, world!» </strong></p>';
$mail->msgHTML($body);
//send the message, check for errors
if (!$mail->send()) {
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message sent!';
}
<br>2019-08-07 07:44:09 Connection: opening to smtp.yandex.com:465, timeout=300, options=array()<br>
2019-08-07 07:44:09 Connection: opened<br>
<br />
<b>Fatal error</b>: Maximum execution time of 180 seconds exceeded in <b>D:\OSPanel\domains\blockchain.mcdir.local\vendor\phpmailer\phpmailer\src\SMTP.php</b> on line <b>1125</b><br />
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question