- Home
- Categorie
- Coding e Sistemistica
- Coding
- Problemi con funzione mail
-
Problemi con funzione mail
Ho un problema con l'invio e-mail dal web.
Questo è il codice che ho creato[php]
// INVIAMO L'E-MAIL
ini_set("SMTP","smtp.nome.com");
ini_set("smtp_port","25");
ini_set("sendmail_from","emailfrom");
$email_from = "[email protected]";
$email_copia = "[email protected]";
$destinatario = [email protected];
$headers = "From: $email_from\n";
$headers .= "CC: $email_copia\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
echo "<br>from = " . $email_from;
echo "<br>copia = " . $email_copia;
echo "<br>dest = " . $destinatario;
if (!mail($destinatario, $oggetto, $info, $headers))
{
echo "$destinatario: Impossibile inoltrare la richiesta a questo indirizzo";
die();
}
else
{
$email_inviata = 1;
}[/php]
Ma quando eseguo la pagina mi da questo errore
Warning: mail() []: SMTP server response: 553 sorry, you need to supply the correct username and password for SMTP-AUTH (#5.7.1) in C:\Programmi\Apache Software Foundation\Apache2.2\htdocs\prova.php on line 27
Che cosa può essere?
-
Ciao freebreathe,
l'errore è di autenticazione, quindi dovrebbe essere errato uno dei dati della connessione.