Answer the question
In order to leave comments, you need to log in
Why isn't a mail message sent when requested from my php site?
Good day! I have a problem. I am creating a site with an authorization system. And when registering
, an email should be sent to the specified email, but it is not sent. Although it is shown that it was successfully sent.
Here is the send code:
require_once('phpmailer/PHPMailerAutoload.php');
$mail = new PHPMailer;
$mail->CharSet = 'utf-8';
// Send mail using Gmail
$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = $email; // GMAIL username
$mail->Password = $password; // GMAIL password
// Typical mail data
$mail->AddAddress($hugof, "");
$mail->SetFrom($hugof, "");
$mail->Subject = "Тема";
$hugot=md5($nor."user");
$mail->Body = "Здравствуйте! Спасибо за регистрацию!\nВаш логин: ".$hugof."\nПерейдите по ссылке, чтобы активировать ваш аккаунт:\nhttp://site.com/andro_r.php?".$hugot."=true";
try{
$mail->Send();
echo "Письмо отправлено!";
} catch(Exception $e){
echo "Извините,но письмо не смогло отправиться!";
}
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