Grazie per il consiglio, prima che mi arrivasse la risposta ci stavo già lavorando.
Comunque con la semplice funzione mail() tutto ok. Ciò però non mi solleva il morale, visto che phpmailer rimane comunque un ottimo e in futuro le sue funzioni mi tornerebbero utili.
Comunque per ringrazziare il supporto dono il mio script finale.
Codice PHP:
<?
require '../libs/Smarty.class.php';
$smarty = new Smarty;
$smarty->template_dir = '../templates/';
$smarty->compile_dir = '../templates_c/';
$smarty->config_dir = '../configs/';
$smarty->chace_dir = '../cache/';
$smarty->compile_check = true;
$nome_c = $_POST['nome_c'];
$mail_c = $_POST['li_c'];
$oggetto_c = $_POST['oggetto_c'];
$messaggio_c = $_POST['messaggio_c'];
$ip = $_SERVER['REMOTE_ADDR'];
$from = "From:" . $nome_c . "<".$mail_c."> \n";
if ($nome_c && $mail_c && $oggetto_c && $messaggio_c){
$pattern="^[^@ ]+@[^@ ]+\.[^@ \.]+$";
if (!ereg($pattern,$mail_c)){
$smarty->display('email.tpl');}
else{
$messaggio = "Nome: " . $nome_c . "\n\n";
$messaggio .= "Oggetto: " . $oggetto_c . "\n";
$messaggio .= "Messaggio: " . $messaggio_c . "\n\n";
$messaggio .= "IP:" . $ip . "\n";
if(mail('xxx@xxx.xxx', $oggetto_c, $messaggio, $from)){
$smarty->display('successo.tpl');
}else{
$smarty->display('error.tpl');
}
}
}
else{
$smarty->display('corr.tpl');
}
?>