Kann nicht zum senden von E-Mails über gmail mit PHPMailer_v5.1

Ich versuche zum senden von E-Mails über gmail mit PHPMailer_V5.1.

Immer folgende Fehlermeldung,

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? (41961176)
SMTP-Fehler: Konnte keine Verbindung zum SMTP-host.

Der folgende code ist der code, die kam mit dem PHPMailer download, ich gerade geändert die
erforderliche Felder

<?php
    require_once('../class.phpmailer.php');
    //include("class.smtp.php"); //optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //the true param means it will throw exceptions on errors, which we need to catch

    $mail->IsSMTP(); //telling the class to use SMTP

    try {
      $mail->Host       = "mail.yourdomain.com"; //SMTP server
      $mail->SMTPDebug  = 2;                     //enables SMTP debug information (for testing)
      $mail->SMTPAuth   = true;                  //enable SMTP authentication
      $mail->SMTPSecure = "ssl";                 //sets the prefix to the servier
      $mail->Host       = "smtp.gmail.com";      //sets GMAIL as the SMTP server
      $mail->Port       = 465;                   //set the SMTP port for the GMAIL server
      $mail->Username   = "[email protected]";  //GMAIL username
      $mail->Password   = "********";            //GMAIL password
      $mail->AddReplyTo('[email protected]', 'First Last');
      $mail->AddAddress('[email protected]', 'John Doe');
      $mail->SetFrom('[email protected]', 'First Last');
      $mail->AddReplyTo('[email protected]', 'First Last');
      $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
      $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; //optional - MsgHTML will create an alternate automatically
      $mail->MsgHTML(file_get_contents('contents.html'));
      $mail->AddAttachment('images/phpmailer.gif');      //attachment
      $mail->AddAttachment('images/phpmailer_mini.gif'); //attachment
      $mail->Send();
      echo "Message Sent OK</p>\n";
    } catch (phpmailerException $e) {
      echo $e->errorMessage(); //Pretty error messages from PHPMailer
    } catch (Exception $e) {
      echo $e->getMessage(); //Boring error messages from anything else!
    }
    ?>
  • Sie scheinen die Einstellung des HOST zu mail.yourdomain.com an der Spitze. Versuchen Sie, und sehen, ob es hilft.
  • kein entfernen es ist nicht keinen Unterschied machen
InformationsquelleAutor San | 2010-01-20
Schreibe einen Kommentar