Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente bannato
    Registrato dal
    Oct 2011
    Messaggi
    185

    classe phpmail errori in vista

    Codice PHP:
    $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       "smtp.gmail.com"// SMTP server
      
    $mail->SMTPDebug  2;                     // enables SMTP debug information (for testing)
      
    $mail->SMTPAuth   false;                  // enable SMTP authentication
      
    $mail->Host       "smtp.gmail.com"// sets the SMTP server
      
    $mail->Port       26;                    // set the SMTP port for the GMAIL server
      
    $mail->Username   "xxx"// SMTP account username
      
    $mail->Password   "xxx";        // SMTP account password
      
    $mail->AddReplyTo('name@yourdomain.com''First Last');
      
    $mail->AddAddress($email_destinatario'John Doe');
      
    $mail->SetFrom('name@yourdomain.com''First Last');
      
    $mail->AddReplyTo('name@yourdomain.com''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('file.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!




    mi da questi errori


    SMTP -> FROM SERVER:
    SMTP -> FROM SERVER: Method EHLO is not supported.
    SMTP -> ERROR: EHLO not accepted from server: Method EHLO is not supported.
    SMTP -> FROM SERVER:
    SMTP -> ERROR: HELO not accepted from server:
    SMTP -> NOTICE: EOF caught while checking if connectedThe following From address failed: name@yourdomain.com

  2. #2
    Utente bannato
    Registrato dal
    Oct 2011
    Messaggi
    185
    ora sto provando cosi


    Codice PHP:
    //error_reporting(E_ALL);
    error_reporting(E_STRICT);

    date_default_timezone_set('America/Toronto');

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

    $body="caxx";
        
    $mail = new PHPMailer();  // creiamo l'oggetto
        
    $mail->IsSMTP(); // abilita SMTP
        
    $mail->SMTPDebug 0;  // debug: 1 = errori e messaggi, 2 = solo messaggi
        
    $mail->SMTPAuth true;  // abilitiamo l'autenticazione
        
    $mail->SMTPSecure 'ssl'// abilitiamo il protocollo ssl richiesto per Gmail
        
    $mail->Host 'smtp.gmail.com'// ecco il server smtp di google
        
    $mail->Port 465// la porta che dobbiamo utilizzare
        
    $mail->Username "xxx"//email del nostro account gmail
        
    $mail->Password "xxx"//password del nostro account gmail
        
    $mail->SetFrom("wergrw@gr.it""gino nardella");
        
    $mail->Subject "ciao";
        
    $mail->Body $body;
        
    $mail->AddAddress("$email_destinatario);
        if(!
    $mail->Send()) {
            
    $error = 'errore mail: '.$mail->ErrorInfo;
            return false;
        } else {
            
    $error = 'Messaggio inviato!';
            return true;
        } 

    ora l'errore èSMTP Error: Could not authenticate.


    email e password di gmail sono esatte.....ma perchè non fuzniona

  3. #3
    Utente bannato
    Registrato dal
    Oct 2011
    Messaggi
    185
    non ci credo che nessuno sa aiutarmi

  4. #4
    Utente bannato
    Registrato dal
    Oct 2011
    Messaggi
    185
    forse su altervista non funziona?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.