http://qs321.pair.com?node_id=723407

madtoperl has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,
I need to send an email with xls file as attachment using perl. when I ran this below code,I got the following error
Connection error from localhost on port 25 ()
While googled this issue, it seems the SMTP server port is blocked. Could you please let me know how can I solve this issue.
The code is given below,
use Mail::Sendmail; %mail = ( To => 'tom@xyz.com', From => 'jerry@xyz.com', Message => "This is a very short message" ); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log;