Ich entwickle auf einem Windows-Apache-Mysql-Php-System meine Internetseite und will gerade eine Form abfragen und per Mail verschicken.
Scheinbar gibt es dafür nur mail().
Ich trage also als smtp-server in der php.ini meinen mailserver(nicht localhost sondern mail.<meinserver>.com) ein.
Ergebnis ist immer ein
der nach ca 30 Sekunden erscheint. Ungefähr zu dieser Zeit kommt dann auch eine Mail bei mir an. Schicke ich dagegen an googlemail.com kommt dort nichts an und es wird zusätzlich zum Fatal ErrorFatal error: Maximum execution time of XY seconds exceeded in XY.php on line XY
angezeigt.553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)
Was ist hier los? Wie kann ich es beheben?
Dann habe ich folgendes probiert:
<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.servername.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "info@servername.com"; // SMTP username
$mail->Password = "xxxx"; // SMTP password
$mail->From = "info@servername.com";
$mail->FromName = "info@servername.com";
$mail->AddAddress("info@servername.com","Honky Tonk");
$mail->AddReplyTo("info@servername.com","Information");
$mail->WordWrap = 50; // set word wrap//
$mail->AddAttachment(""); // attachment//
$mail->AddAttachment("");
$mail->IsHTML(false); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the <b>HTML body</b>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
Ergebnis: Es bricht ohne Fehlermeldung ab und es kommt keine mail an.