| zing_foru 2006-11-16, 6:07 am |
| Hi all,
How to send an email using Mail::Mailer module.
I want to send a mail to local users using perl.
I downloaded Mail::Mailer module from cpan.org and install on my system. Then written a test program as follows to test:-
code:
#!/usr/bin/perl -w
use Mail::Mailer;
$from_addr = "test1\@mail.localhost.com.";
$to_addr = "test2\@mail.localhost.com.";
$subject = "mail testing using perl module";
$body = "just testing";
#$mailer = Mail::Mailer->new("sendmail");
$mailer = Mail::Mailer->new();
$mailer->open({ From => $from_addr,
To => $to_addr,
Subject => $subject,
})
or die "Can't open: $!\n";
print $mailer $body;
$mailer->close();
The above code executed without giving any error. After execution the status of Inbox of test2 user doesn't show the mail sent.
Also I can send a mail using GUI -> squiralmail. Using squiralmail I can sent mails to other users.
The same I want to do using Perl module as mentioned.
Please can any one of you solve this problem or any idea to solve
Please reply
Thanx in advance..
regards... zing_foru |