codice:
$mail = new PHPMailer(true);
try {
//Server settings
$mail->SMTPDebug = 2;
$mail->isSMTP();
$mail->Host = 'smtp.aruba.it';
$mail->SMTPAuth = true;
$mail->Username = 'info@miodominio.com';
$mail->Password = 'password';
$mail->SMTPSecure = 'tls';
$mail->Port = 465;
$mail->setFrom('info@miodominio.com', 'miodominio');
$mail->addAddress('destinatario');
$mail->isHTML(true);
$mail->Subject = '| Registrazione completata con successo';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->Body = "<
<html>
<head>
<title>Registrazione avvenuta con successo</title>
</head>
<body>
<h1>Benvenuto su MioDominio!</h1>
<h4>Le tua registrazione è avvenuta con successo, queste sono le tue credenziali:</h4>
<p><b>Username:</b>". $username ."</p>
<p><b>Password:</b>". $password ."</p>
</body>
</html>
";
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
$mail->SmtpClose();
unset($mail);
Ho provato ad utilizzare questo script, ma quando lo avvio il browser si blocca per tipo due minuti restituendomi solo "504 - Gateway time-out". Nessun errore nel log, nulla di nulla.
Qualcuno sa aiutarmi?