![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| hp ux not sending mail | kkhan | HP-UX | 3 | 01-31-2008 11:27 PM |
| Mail sending | panknil | Shell Programming and Scripting | 15 | 09-19-2007 02:24 AM |
| help on sending mail in ksh | ting123 | UNIX for Dummies Questions & Answers | 2 | 04-05-2006 08:35 PM |
| sending mail | mskarica | UNIX for Advanced & Expert Users | 3 | 04-12-2005 09:59 AM |
| sending a mail to a mail client | solaris73 | UNIX for Dummies Questions & Answers | 5 | 11-18-2002 01:58 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi all this is the code which i tried executing in windows environment to send a test mail. Code:
# Perl script to send mail on deliver complete.
package SendMail;
use Config;
use Mail::Send;
@ISA = qw(Mail::Send);
sub open {
my $me = shift;
my $how; # How to send mail
my $notused;
my $mailhost;
# On Windows use SMTP
if ($Config{'osname'} eq 'MSWin32') {
$how = 'smtp';
$mailhost = "smtp.dev.xxxxxxxx.com";
}
# else use defaults supplied by Mail::Mailer
Mail::Mailer->new($how, $notused, $mailhost)->open($me);
}
#
##################################################################
# Main program
my @to = "zzzz@dev.xxxxxxxxx.com";
my $subject = "Delivery complete";
my $body = join '',( "this is testing from perl in windows");
my $msg = new SendMail(Subject=>$subject);
$msg->to(@to);
my $fh = $msg->open($me);
$fh->print($body);
$fh->close();
1; # return success
#
##################################################################
But i am getting an error as follows [CODE> Can't locate Mail/Send.pm in @INC (@INC contains: c:/Perl/lib c:/Perl/site/lib . ) at ml.pl line 10. BEGIN failed--compilation aborted at ml.pl line 10. [/CODE] I have checked C:/Perl/lib, Send.pm doesnt exist. how do i get this script run so that i can send mail using perl in the windows environment. regard Victor vinod Kumar |
| Bookmarks |
| Tags |
| perl, perl shift, sendmail, shift, shift perl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|