PHPmailer von localhost?

Ich bin sehr neu in PHP. Ich habe einen phpmailer-script (mit Dateien) von hier -> phpmailer

Bin ich mit XAMPP und ich habe die Dateien gefunden in:

\htdocs\QMS\phpmailer

Mein php-script befindet sich in: \htdocs\QMS\

Bekomme ich die Meldung, dass die mail verschickt wurde, aber ich sehe nichts in meinem Posteingang, Papierkorb oder spam. Ich habe versucht, andere E-Mail-Adressen und immer noch nichts.

Hier der code: (*E-Mail-Adressen und Namen wurden maskiert mit "xxx")

<?php
require_once('phpmailer/class.phpmailer.php');

$mail = new PHPMailer(); //defaults to using php "mail()"
$mail->AddReplyTo("[email protected]","xxx xxx");
$mail->SetFrom('[email protected]","xxx xxx');

$mail->AddReplyTo('[email protected]","xxx xxx');

$body = "This is a test... It works!";
$address = "[email protected]";
$mail->AddAddress($address, "xxx xxx");

$mail->Subject    = "A subject line here";

$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; //optional, comment out and test

$mail->MsgHTML($body);

$mail->AddAttachment("images/phpmailer.gif");      //attachment
$mail->AddAttachment("images/phpmailer_mini.gif"); //attachment

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}

?>
Sie haben KEINE E-mail-server!
Sie können postfix zumindest für unix-basierte OS.

InformationsquelleAutor bagofmilk | 2013-11-04

Schreibe einen Kommentar