Sto testando lo script in locale.
ho apache 2.x e php 4.3.x
nel php.ini ho settato
[mail function]
; For Win32 only.
SMTP = localhost
; For Win32 only.
sendmail_from = mia@email.it
quando provo ad inviare l'email con il codice che trovate sotto ricevo ilseguente messaggio di errore:
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Programmi\Apache Group\Apache2\htdocs\home\include\reg.inc.php on line 89
Si sono verificati problemi nell'invio dell'email
cosa sbaglio?
codice:
If ($conf_email == 1) {
$str_oggetto = "Conferma Registrazione";
$str_server = $_SERVER['HTTP_HOST'];
$str_script_name = $_SERVER['SCRIPT_NAME'];
$str_link = "http://".$str_server.$str_script_name."?statoreg=verify&email=".$str_EmailAddress."&codattiv=".$str_cod_attivazione;
$str_contenuto_email = $msg_email_att_reg;
$str_contenuto_email = str_replace("{name}",$str_Username_new,$str_contenuto_email);
$str_contenuto_email = str_replace("{old_name}",$str_Username_old,$str_contenuto_email);
$str_contenuto_email = str_replace("{email}",$str_EmailAddress,$str_contenuto_email);
$str_contenuto_email = str_replace("{ip}", $str_ind_ip,$str_contenuto_email);
$str_contenuto_email = str_replace("{link}",$str_link,$str_contenuto_email);
$headers = "From: $name<$email>\nReply-to:$email";
If (!mail($str_EmailAddress,$str_oggetto,$str_contenuto_email,$headers)) {
echo "Si sono verificati problemi nell'invio dell'email";
}
}