Devi gestire anche il caso in cui non ci sia l'allegato
sostituisci
[FONT=Courier New][COLOR=#007700]else [/COLOR][/FONT]
[FONT=Courier New][COLOR=#007700]{ [/COLOR][/FONT]
[FONT=Courier New][COLOR=#007700] echo [/COLOR][COLOR=#dd0000]"<p>Errore!</p>"[/COLOR][/FONT][FONT=Courier New][COLOR=#007700]; [/COLOR][/FONT]
[FONT=Courier New][COLOR=#007700]} [/COLOR][/FONT]
con
[FONT=Courier New][COLOR=#007700]else [/COLOR][/FONT]
[FONT=Courier New][COLOR=#007700]{ [/COLOR][/FONT]
[FONT=Courier New][COLOR=#0000bb] $msg [/COLOR][COLOR=#007700].= [/COLOR][COLOR=#0000bb]$messaggio;[/COLOR][/FONT]
[FONT=Courier New][COLOR=#007700]} [/COLOR][/FONT]