tags:

views:

41

answers:

1

I am using the below code to send an email

#!/usr/bin/perl

sub BEGIN {
        unshift (@INC,'/opt/dev/common/mds/perlLib');
}

use Mail::Sender;

$sender = new Mail::Sender
{smtp => 'xxx.xxx.x.xx', from => '[email protected]'};
$sender->MailFile({to => '[email protected]',
subject => 'Here is the file',
msg => "I'm sending you the list you wanted."});

$sender->Close;

But, it is not sending the mail at all. What is wrong in my code?

+2  A: 

Got it myself... Should have used MailMsg instead of MailFile. Thanks!

Flower07