Sending Email - Problem

Hi All,
I am getting a problem while sending the Email.Here is the code for that.
********************************************************
use MIME::Entity;

sub emailRpt
{
      my ($fileToEmail, $locationOfFile) = @_;
      my $toEmailList = getConfigString("AVD_ADDENDUM_DATE_REPORT", "toEmailList");
      my $fromEmailAddress = getConfigString("AVD_ADDENDUM_DATE_REPORT", "fromEmailAddress");
      my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime( );
      $mon++;
        $year+=1900;
       
        $mon = sprintf("%02d", $mon);
        $mday = sprintf("%02d", $mday);
        my $subject = "$reportName  ${mon}\/${mday}\/${year}";
            my $body = "Report Attached";

      print LOG "Email is been sent to $toEmailList with subject $subject and file attached is -$fileToEmail \n";      

      timeTest::emailAttachFile("$toEmailList",
                  "$fromEmailAddress",
                  "$subject",
                  "$body",
                  "$fileToEmail",
                  "$locationOfFile");
}
**********************************************************

Now i am getting this error while trying to send this email.

**********************************************************
This error was when i did not do anything on the system.
***********************************************************
egypt IT_test_nbo_27_fst_prov> perl v
Can't locate MIME/Entity in @INC (@INC contains: /usr/local/lib/perl5/5.00503/sun4-solaris /usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 .) at /usr/local/lib/perl5/site_perl/5.005/MIME/Entity.pm line 223. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.005/MIME/Entity.pm line 223. BEGIN failed--compilation aborted at v line 14.
****************************************************
After copying Entity.pm
****************************************************
egypt IT_test_nbo_27_fst_prov> perl v
Can't locate MIME/ToolUtils.pm in @INC (@INC contains: /usr/local/lib/perl5/5.00503/sun4-solaris /usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 .) at /usr/local/lib/perl5/site_perl/5.005/MIME/Entity.pm line 223. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.005/MIME/Entity.pm line 223. BEGIN failed--compilation aborted at v line 14.
*********************************************
After copying ToolsUtils.pm
********************************************
egypt IT_test_nbo_27_fst_prov> perl v
Can't locate MIME/Head.pm in @INC (@INC contains: /usr/local/lib/perl5/5.00503/sun4-solaris /usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 .) at /usr/local/lib/perl5/site_perl/5.005/MIME/Entity.pm line 224. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.005/MIME/Entity.pm line 224. BEGIN failed--compilation aborted at v line 14.
********************************************************
After copying everying under the MIME directory from scarlet Unix System  to egypt Unix System egypt . It is working fine on scarlet Unix System  but on egypt. scarlet and egypat are name of the Unix box. So do not get confused from that.
**********************************************************
IT_test_nbo_27_fst_prov> perl v Can't locate IO/Wrap.pm in @INC (@INC contains: /usr/local/lib/perl5/5.00503/sun4-solaris /usr/local/lib/perl5/5.00503 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 .) at /usr/local/lib/perl5/site_perl/5.005/MIME/Head.pm line 111. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.005/MIME/Head.pm line 111. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.005/MIME/Entity.pm line 224. BEGIN failed--compilation aborted at v line 14. egypt IT_test_nbo_27_fst_prov>
*****************************************
Now it seems that egypat Unix box is not having that Entity.pm module which creating problem.I do not have privilages to change that and we are using PERL 5.005003
Now i am having a question here whether we can modify this code in some way so that it can work.

Thanks in advance.

Regards,
Aaku
akku_batraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jmcgOwnerCommented:
The short answer is that you will get the greatest satisfaction if the Perl environments on the various servers can be brought up to the same level -- same version of Perl, same suite of modules installed.

If that's not possible, you can get fairly close using the approach that it seems you are already using: installing the missing modules into whatever filesystem space you are allowed to use on the server. Perl's

use lib qw(/path/to/library);

statement can be added at the top of your scripts to enable use of these additional modules.

In the Perl FAQ, there's a question "how do I keep my own module/library directory" that addresses this general topic, but it does not quite tell you what to do when you are copying files over to a server where you do not have full login privileges. Because you can only copy files, you may find you can't install some modules this way because they require compilation of some components on the target machine. That can effectively prevent you from using such a module.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TintinCommented:
As jmcq says, you don't install modules by just blindly copying files.  You use the standard way of installing, ie:

perl Makefile.PL
make
make test
make install

Why are you using  MIME::Entity to send mail?  Most people use MIME::Lite as it is very easy to use (and install)
0
BlackDiamondCommented:
The perl CPAN module will help you install those modules correcly (it will also take care of the dependency issues that you are encountering).  Problem is that you will likely need root to run it successfully. The command to run is:

perl -MCPAN -e 'install MIME'
0
TintinCommented:
Hence the reason MIME::Lite is better to use as it consists of a single file.
0
jmcgOwnerCommented:
Nothing has happened on this question in more than 7 weeks. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
split points between jmcg and Tintin.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.