Я новичок в PHP, и я пытаюсь использовать PHP Mailer в первый раз. Я установил учетную запись SMTP и ввел следующую информацию:PHPMailer не отправляет на hotmail e-mail
<?php
require("cscie12/final project/PHPMailer/PHPMailer_5.2.0/class.PHPMailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "ssrs.reachmail.net"; // specify main and backup server
$mail->Port = "25";
$mail->SMTPAuth = plain; // turn on SMTP authentication
$mail->Username = "BRYANSAY\bryan"; // SMTP username
$mail->Password = "***********"; // SMTP password
$mail->From = "[email protected]";
$mail->FromName = "Contact Form";
$mail->AddAddress("[email protected]", "Bryan Sayles");
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Contact Form";
$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. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
}
echo "Message has been sent";
?>
Но я не получаю электронное письмо. Я получаю это на моей странице:
IsSMTP(); // set mailer to use SMTP $mail->Host = "ssrs.reachmail.net"; // specify main and backup server $mail->Port = "25"; $mail->SMTPAuth = plain; // turn on SMTP authentication $mail->Username = "BRYANSAY\bryan"; // SMTP username $mail->Password = "********"; // SMTP password $mail->From = "[email protected]"; $mail->FromName = "Contact Form"; $mail->AddAddress("[email protected]", "Bryan Sayles"); $mail->WordWrap = 50; // set word wrap to 50 characters $mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments $mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name $mail->IsHTML(true); // set email format to HTML $mail->Subject = "Contact Form"; $mail->Body = "This is the HTML message body in bold!"; $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; exit; } } echo "Message has been sent"; ?>
Мне что-то не хватает, но не знаю, что. Вы можете помочь? Благодарю.