Why would any error show up when you are doing an
open without following the advice in
perlsyn and putting in a check for errors? A check that should include what you are going and the context fo $!.
That said, I would suggest Mail::Send for the problem...