Ciao, non ho molta praticità di php; utilizzo un form mail che funziona perfettamente, unico problema è che l'email che si riceve ha come mittente anonymous@webxc12s02.ad.aruba.it. Tra i miei form ho un campo $email e vorrei poter passare questa variabile nell'header (si chiama così?) dell'email, come avviene per il subject.
questa dvrebbe essere la parte di codice da modificare:
Codice PHP:
error_reporting(0);
include('contact_settings.php');
include('TemplateMailer.class.php');
$temp = new TemplateMailer();
function daj($msg) {
global $template_folder,$temp;
$temp->assign('errmsg',$msg);
$temp->preparemail($template_folder . 'prenota_error.tpl.html');
die($temp->body);
}
$reason = $_POST['reason'];
$credit = $_POST['credit'];
$numero = $_POST['numero'];
$intestatario = $_POST['intestatario'];
$scadenza = $_POST['scadenza'];
$sicurezza = $_POST['sicurezza'];
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$company = $_POST['company'];
$uscita = $_POST['uscita'];
$subj = $_POST['subject'];
$description = $_POST['text'];
if (trim($description) == "") { daj("Devi inserire un messaggio."); }
$temp->assign('reason',$reason);
$temp->assign('credit',$credit);
$temp->assign('numero',$numero);
$temp->assign('intestatario',$intestatario);
$temp->assign('scadenza',$scadenza);
$temp->assign('sicurezza',$sicurezza);
$temp->assign('name',$name);
$temp->assign('email',$email);
$temp->assign('phone',$phone);
$temp->assign('uscita',$uscita);
$temp->assign('company',$company);
$temp->assign('message',$description);
$temp->preparemail($template_folder . 'prenota_mail.tpl.html');
$adresa = $reasons[$reason];
$sent = $temp->send($email,$adresa,$email_subject.' '.$subj,'');
if ($sent) {
$disya = basename($_SERVER['PHP_SELF']);
$disya = str_replace('.php','.tpl.html',$disya);
$temp->assign("template_file",$disya);
$temp->preparemail($template_folder . $disya);
echo $temp->body;
}
else { daj("There was an error with sending e-mail message. Please try again later!"); }