Ich bin neu in PHP und ich versuche, den PHP-Mailer zum ersten Mal zu verwenden. Ich habe ein SMTP-Konto eingerichtet und in meine Informationen eingegeben:PHPMailer nicht an hotmail E-Mail senden
<?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";
?>
Aber ich erhalte keine E-Mail. Ich bekomme das auf meiner Seite:
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"; ?>
Ich vermisse etwas irgendwo, aber nicht sicher, was. Kannst du helfen? Vielen Dank.