PHPMailer funktioniert nicht: Nachricht nicht versendet werden konnte

Ich versuche zu erstellen, ein Kontaktformular auf meiner website mithilfe von PHPMailer. Ich habe einige Probleme, die es einrichten. Ich bin versucht, G-mail, das mein smtp-host. Ich Frage mich, wenn jemand helfen kann ich dies beheben?

Dies ist mein mailer-code:

<?php
require("class.phpmailer.php");
require("class.smtp.php");

$mail = new PHPMailer();

$mail->IsSMTP();   
$mail->SMTPAuth = true;     //turn on SMTP authentication      
$mail->SMTPSecure = 'ssl'; //secure transfer enabled REQUIRED for GMail        
$mail->Host = 'smtp.gmail.com';
$mail->Port = 467;  

$mail->Username = "[email protected]";  //SMTP username
$mail->Password = "workingpassword"; //SMTP password

$mail->From = "[email protected]";
$mail->FromName = "Mailer";
$mail->AddAddress("[email protected]", "Josh Adams");
$mail->AddAddress("[email protected]");                  //name is optional
$mail->AddReplyTo("[email protected]", "Information");

$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 = "Here is the subject";
$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";
?>

Die Fehlermeldung:

Message could not be sent.
Mailer Error: The following From address failed: validmail@gmail.com
Schwer zu sagen, warum es nicht funktioniert. Haben Sie versucht $mail->SMTPDebug = 1;
Ja das habe ich. Dies ist der Fehler, es wird angezeigt : SMTP -> FEHLER: Failed to connect to server: kann Nicht finden die socket Transports "ssl" - hast du vergessen, um es zu aktivieren bei der Konfiguration von PHP? (12640394)

InformationsquelleAutor AnchovyLegend | 2012-06-11

Schreibe einen Kommentar