in reply to Help with script using sendmail

While you could handle opening the pipe to Sendmail yourself, it's better for a bazillion reasons to use a module. And you always can, if you're crafty (and your host is cruel). The easist for you is to cut and paste the entire module into a BEGIN block, and put it inside your script, like so:

#usr/bin/perl -wT package main; use strict; # Your code goes here # Whatever you need # To do, using the module #Might wanna add #some blank line for clarity BEGIN { #cut 'n' paste module here }
Cheers,
Erik

Replies are listed 'Best First'.
Re: Re: Sendmail
by growlf (Pilgrim) on Mar 29, 2002 at 05:44 UTC

    ..or with the "use" syntax, simply include the local version of the module (that you have copied in as a support file).

    This tactic does NOT always work however - many perl modules do use C and other compiled portions - these types of modules, of course, will not function by just being copied in, in most cases.  However, in Mail::Sendmail, as documented by the author in it's POD, "Only requires Perl 5 and a network connection." - and is a suggested method in PerlDoc's Portable Code page.

    - so fly free, and enjoy the easy use as a local module.

    Update:
    This might help as well - look towards the bottom for the part on "what if i do not have permission to install..." - thanks footpad!



    *G*

      Thanks growlf! I am going to take a look at the resources you posted.

      Thanks again!

      sulfericacid

Re: Re: Sendmail
by venimfrogtongue (Novice) on Mar 29, 2002 at 14:20 UTC

    Thank Erik!

    I never played with modules so I didn't know if it was just plain text or whatnot. I might use your idea and use it within my script. Just have to think about it for a little bit, don't want to do anything my webhost would cancell me for. Their the only webhost I can get for my page, lol.

    I think I am going to go read on mail::sendmail now, thanks for your help!!!

    Aaron