in reply to Using The Mail::Sendmail module in CGI Script

firstly i have tried by using the sendmail pipe there it worked perfectly and i was able to send mail but when i am using the module i am getting the error.
It's not quite clear what do you mean by that sentence. Do you mean that the Mail::Sendmail module doesn't work under your cgi script although it works as normal Perl script?

If so perhaps your problem is that your script doesn't recognize the module. You can try to direct the location of your perl modules with .htaccess.

In a .htaccess file, put
SetEnv PERL5LIB /where/the/mods/are/:/where/else/lib
Then get your script going, by the following snippet.
#!/usr/bin/perl -w use CGI ':standard'; # Newly inserted BEGIN { if ( $ENV{PERL5LIB} and $ENV{PERL5LIB} =~ /^(.*)$/ ) { # Blindly untaint. Taintchecking is to protect # from Web data; # the environment is under our control. eval "use lib '$_';" foreach ( reverse split( /:/, $1 ) ); } } use Mail::Sendmail; # The rest of the script....

Regards,
Edward

Replies are listed 'Best First'.
Re^2: Using The Mail::Sendmail module in CGI Script
by msk_0984 (Friar) on Jul 19, 2006 at 08:56 UTC
    Yes Sir

    Its right it works in normal perl script but does not work when use the CGI script. Ok so that means ur right that my CGI script doesn't recognize the module.

    Ok i am going to try it out