Non sono sicuro che funzioni, ma prova cosi:
Codice PHP:
$destinatario="";
$mittente="";
$m = new MAIL; // initialize MAIL class
$m->From($mittente); // set From mail address
$m->AddTo($destinatario); // add To mail address
$m->Subject($_POST['oggetto']); // set your mail subject
// set your mail message (text/html)
$m->Html("Data: ".date('D d/m/Y H:i:s')."\nIP: ".$_SERVER['REMOTE_ADDR']."\n\n".$_POST['messaggio']);
// connect to MTA server 'smtp.gmail.com' port '465' via SSL ('tls' encryption)
// with authentication: 'username@gmail.com' and 'password'
// set the connection timeout to 10 seconds, the name of your
// host 'localhost' and the authentication method to 'plain'
// make sure you have OpenSSL module (extension) enable on your php configuration
$c = $m->Connect('smtp.aruba.it', 465, null, null,
null, 10, 'localhost', null, 'plain') or die(print_r($m->Result));
// send mail relay using the '$c' resource connection
echo $m->Send($c) ? print ("<script> alert("Il tuo messaggio è stato inviato con successo!") </script>");include("chi.html") : print ("<script> alert("Errore invio E-mail!") </script>");include("contattaci.html");
// disconnect from server
$m->Disconnect();
Non sono sicuro al 100% che funzioni, e ricontrolla le impostazioni che ho messo per l'SMTP xk non mi ricordo qual'è quello di aruba.
Spero che vada bene cosi.....