codice:
sub SendEmail(){
local $MessaggeError;
$Subject ="soggetto";
$Mittente = "pippo@pippo.com";
$MailServer = "pippo.pippo.com";
$Email = "pippo@pippo.com";
$General_Testo = "piero testo";
$General_Html = "piero html";
$LnMail = new Mail::Sender { smtp => $MailServer, ctype => "text/html",encoding => "7bit" };
$LnMail->OpenMultipart({ subject => $Subject, from => $Mittente, to => $Email });
$LnMail->Part({ctype => 'multipart/related'});
$LnMail->Part({ctype => 'text/plain', disposition => 'NONE', msg => $General_Testo });
$LnMail->Part({ctype => 'text/html', disposition => 'NONE', msg => $General_Html});
$LnMail->EndPart("multipart/related");
$LnMail->Close();
$Errore=$LnMail->Error();
$Ret=1;
if ($Errore ne ''){
$MessaggeError = "Errore di spedizione $Email";
SaveLog("$Conf{'WORK_DIR'}$Conf{'FILE_ERROR_LOG'}",$MessaggeError);
$Ret=$Errore;
}
return $Ret;
}
la funzione è questa, premetto che ha sempre funzionato
la linea 35 è
$LnMail->OpenMultipart({ subject => $Subject, from => $Mittente, to => $Email });