> > #!/usr/bin/perl > > use Mail::Sender; > $i = scalar (@ARGV); > > $sender = new Mail::Sender > {smtp => 'server.smtp.com', from => '[EMAIL PROTECTED]'}; > $sender->MailFile({to => '[EMAIL PROTECTED]', > subject => '$arg[0]', > msg => "$arg[1]", > file => '$arg[2]'}); > > $sender->Close; > > > this script call as following : > sendmail.pl <subject> <body> <path to attachment> >
I never use this module, so i am not familiar with it. Have you read the docs for Mail::Sender ? It looks like you are using the example from the docs. here is what i think you want: -- # enable warnings #!/usr/bin/perl -w use Mail::Sender; # i don't think you need this line #$i = scalar (@ARGV); # add some error checking # i don't think these are the real names of your server and email # addresses, you need to replace them with the your own # you want $ARGV not $arg $sender = new Mail::Sender {smtp => 'server.smtp.com', from => '[EMAIL PROTECTED]'} or die $!; $sender->MailFile({to => '[EMAIL PROTECTED]', subject => '$ARGV[0]', msg => "$ARGV[1]", file => '$ARGV[2]'}); $sender->Close; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]