"Fossies" - the Fresh Open Source Software Archive

Member "formmail_modules-3.14m1/lib/CGI/NMS/Mailer/ByScheme.pm" (11 Aug 2004, 1492 Bytes) of package /linux/www/old/formmail_modules-3.14m1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ByScheme.pm" see the Fossies "Dox" file reference documentation.

    1 package CGI::NMS::Mailer::ByScheme;
    2 use strict;
    3 
    4 =head1 NAME
    5 
    6 CGI::NMS::Mailer::ByScheme - mail sending engine switch
    7 
    8 =head1 SYNOPSYS
    9 
   10   my $mailer = CGI::NMS::Mailer::ByScheme->new('/usr/lib/sendmail -oi -t');
   11 
   12   my $mailer = CGI::NMS::Mailer::ByScheme->new('SMTP:mailhost.bigisp.net');
   13 
   14 =head1 DESCRIPTION
   15 
   16 This implementation of the mailer object defined in L<CGI::NMS::Mailer>
   17 chooses between L<CGI::NMS::Mailer::SMTP> and L<CGI::NMS::Mailer::Sendmail>
   18 based on the string passed to new().
   19 
   20 =head1 CONSTRUCTORS
   21 
   22 =over
   23 
   24 =item new ( ARGUMENT )
   25 
   26 ARGUMENT must either be the string C<SMTP:> followed by the name or
   27 dotted decimal IP address of an SMTP server that will relay mail
   28 for the web server, or the path to a sendmail compatible binary,
   29 including switches.
   30 
   31 =cut
   32 
   33 sub new {
   34   my ($pkg, $argument) = @_;
   35 
   36   if ($argument =~ /^SMTP:([\w\-\.]+(:\d+)?)/i) {
   37     my $mailhost = $1;
   38     require CGI::NMS::Mailer::SMTP;
   39     return CGI::NMS::Mailer::SMTP->new($mailhost);
   40   }
   41   else {
   42     require CGI::NMS::Mailer::Sendmail;
   43     return CGI::NMS::Mailer::Sendmail->new($argument);
   44   }
   45 }
   46 
   47 =back
   48 
   49 =head1 MAINTAINERS
   50 
   51 The NMS project, E<lt>http://nms-cgi.sourceforge.net/E<gt>
   52 
   53 To request support or report bugs, please email
   54 E<lt>nms-cgi-support@lists.sourceforge.netE<gt>
   55 
   56 =head1 COPYRIGHT
   57 
   58 Copyright 2003 London Perl Mongers, All rights reserved
   59 
   60 =head1 LICENSE
   61 
   62 This module is free software; you are free to redistribute it
   63 and/or modify it under the same terms as Perl itself.
   64 
   65 =cut
   66 
   67 1;
   68