Pare che la porta 25 sia giusta.
Questo è quello che ho trovato sui vari siti:
SMTP:
indirizzo: smtp.live.com
porta: 25;
SSL: sì;
autenticazione: necessaria;
Però adesso ho risolto il problema:
Per inviare la mail uso il file mail.php di PEAR
Codice PHP:
<?php
require_once "C:/xampp/php/PEAR/mail.php";
$from = '"WineShop Srl" <mia_mail@hotmail.it>';
$to =$_SESSION['IDcliente'];
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "smtp.live.com";
$username = "mia_mail@hotmail.it";
$password = "Password";
$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>");
}
?>
Ora la mail arriva!!!!
L'unico problema è che mi viene stampato a schermo
Strict Standards: Non-static method Mail::factory() should not be called statically in C:\xampp\htdocs\vineria\ordina.php on line 219
trict 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 517
per molte linee diverse.
Io purtroppo è poco che programmo in php, qualcuno sa cosa vuol dire questo errore?