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.
SMTP -> ERROR: EHLO not accepted from server: Method EHLO is not supported.
SMTP -> ERROR: HELO not accepted from server:
SMTP -> ERROR: AUTH not accepted from server:
SMTP -> NOTICE: EOF caught while checking if connectedSMTP Error: Could not authenticate.
email e password di gmail sono esatte.....ma perchè non fuzniona