The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-06-2006
victorvvk victorvvk is offline
Registered User
  
 

Join Date: Mar 2005
Location: Hyderabad, india
Posts: 32
Question sending mail using perl through windows

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
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0