Answer the question
In order to leave comments, you need to log in
Why does this script not send a letter to the mail (working script)?
Here is my script
Everything is on the hosting ru center
When submitting the form, there is an endless loading
. It is necessary to send from Yandex mail to another mail.
Help fix the script
<?php
$mail = new PHPMailer;
//будем отравлять письмо через СМТП сервер
$mail->isSMTP();
//хост
$mail->Host = 'smtp.yandex.ru';
//требует ли СМТП сервер авторизацию/идентификацию
$mail->SMTPAuth = true;
// логин от вашей почты
$mail->Username = '[email protected]';
// пароль от почтового ящика
$mail->Password = 'secret';
//указываем способ шифромания сервера
$mail->SMTPSecure = 'ssl';
//указываем порт СМТП сервера
$mail->Port = '465';
//указываем кодировку для письма
$mail->CharSet = 'UTF-8';
//информация от кого отправлено письмо
$mail->From = '[email protected]';
$mail->FromName = 'Админ';
$mail->addAddress('[email protected]');
$mail->isHTML(true);
$mail->Subject = 'Тема письма';
$mail->Body = 'Текст можно с хтмл';
if( $mail->send() ){
echo 'Письмо отправлено';
}else{
echo 'Письмо не может быть отправлено. ';
echo 'Ошибка: ' . $mail->ErrorInfo;
}
?>
Answer the question
In order to leave comments, you need to log in
Author, URGENT, you burned your account password, I just managed to log into it. REMOVE AND CHANGE IT.
perhaps the SSL module is not enabled or not configured on the hosting
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question