| zing_foru 2006-11-22, 5:37 am |
| Hi all
I have written a sendmail script using
Mail::Mailer (sendmail) module on Linux machine.
I need to execute same script on windows
platform. For that I tried to Install
Mail::Mailer module using ppm on windows.
But unfortunetly through ppm installation
failed. So I directly copied Mail folder
which contains all the .pm files including
Mailer.pm, sendmail.pm, smtp.pm
And tried the following code
code:
#!C:\Perl\bin -w
use Mail::Mailer;
$from_addr = "<from\@domain.com>";
$to_addr = "<to\@domain.com>";
$subject = "testing sendmail on windows";
$msg_body = "just testing";
# Create a new instance of sendmail program to deliver the mail
$mailer = Mail::Mailer->new();
# Header of the message
$mailer->open({ From => $from_addr,
To => $to_addr,
Subject => $subject,
})
or die "Can't open: $!\n";
# Print the body of your message
print $mailer $msg_body;
# Close the Mail::Mailer object
$mailer->close() or die "Can't close mailer: $!\n";
At execution it is giving an error
quote:
Died at C:/Perl/lib/Mail/Mailer.pm line 285.
Can anybody now how to fix it?
Thanks.. |