
richter at apache
Oct 13, 2002, 10:05 PM
Post #1 of 1
(88 views)
Permalink
|
|
cvs commit: embperl/test/html mailformto.htm
|
|
richter 2002/10/13 22:05:47 Modified: . Tag: Embperl2c Changes.pod MANIFEST Embperl Tag: Embperl2c App.pm Util.pm test/cmp2 Tag: Embperl2c varerr.htm Added: test/cmp Tag: Embperl2c mailformto.htm test/html Tag: Embperl2c mailformto.htm Log: readded MailFormTo Revision Changes Path No revision No revision 1.129.4.98 +1 -0 embperl/Changes.pod Index: Changes.pod =================================================================== RCS file: /home/cvs/embperl/Changes.pod,v retrieving revision 1.129.4.97 retrieving revision 1.129.4.98 diff -u -r1.129.4.97 -r1.129.4.98 --- Changes.pod 11 Oct 2002 19:40:55 -0000 1.129.4.97 +++ Changes.pod 14 Oct 2002 05:05:45 -0000 1.129.4.98 @@ -32,6 +32,7 @@ and doesn't work as before. - Fixed problem with [$ sub $] when running under Perl 5.8.0. - Fixed problem when STDOUT is tied, because storege has changed in Perl 5.8.0. + - Readdeded missing MailFormTo and added test for it. =head1 2.0b8 (BETA) 25. Juni 2002 1.50.4.55 +3 -0 embperl/MANIFEST Index: MANIFEST =================================================================== RCS file: /home/cvs/embperl/MANIFEST,v retrieving revision 1.50.4.54 retrieving revision 1.50.4.55 diff -u -r1.50.4.54 -r1.50.4.55 --- MANIFEST 1 Jul 2002 06:58:16 -0000 1.50.4.54 +++ MANIFEST 14 Oct 2002 05:05:45 -0000 1.50.4.55 @@ -272,6 +272,8 @@ test/cmp/loop.htm test/cmp/loopperl.htm test/cmp/mdatsess.htm +test/cmp/mail.htm +test/cmp/mailformto.htm test/cmp/mix.htm test/cmp/nesting.htm test/cmp/nochdir.htm @@ -468,6 +470,7 @@ test/html/loop.htm test/html/loopperl.htm test/html/mail.htm +test/html/mailformto.htm test/html/match/div.asc test/html/match/div.htm test/html/mdatsess.htm No revision No revision 1.1.2.7 +69 -1 embperl/Embperl/Attic/App.pm Index: App.pm =================================================================== RCS file: /home/cvs/embperl/Embperl/Attic/App.pm,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -r1.1.2.6 -r1.1.2.7 --- App.pm 11 Sep 2002 09:17:19 -0000 1.1.2.6 +++ App.pm 14 Oct 2002 05:05:45 -0000 1.1.2.7 @@ -220,6 +220,59 @@ return $ok ; } +# --------------------------------------------------------------------------------- +# +# MailFormTo +# +# --------------------------------------------------------------------------------- + + +sub mail_form_to + + { + my ($self, $to, $subject, $returnfield) = @_ ; + my $v ; + my $k ; + my $ok ; + my $smtp ; + my $ret ; + my $r = $self -> curr_req ; + my $fdat = $r -> thread -> form_hash ; + + $ret = $fdat -> {$returnfield} ; + + require Net::SMTP ; + + $smtp = Net::SMTP->new($self -> config -> mailhost || 'localhost', + Debug => $self -> config -> maildebug || 0, + $self -> config -> mailhelo?(Hello => $self -> config -> mailhelo):()) + or die "Cannot connect to mailhost" ; + + $smtp->mail($self -> config -> mailfrom || "WWW-Server\@$ENV{SERVER_NAME}"); + $smtp->to($to); + $ok = $smtp->data(); + $ok = $smtp->datasend("Reply-To: $ret\n") if ($ok && $ret) ; + $ok and $ok = $smtp->datasend("To: $to\n"); + $ok and $ok = $smtp->datasend("Subject: $subject\n"); + $ok and $ok = $smtp->datasend("\n"); + foreach $k (@{$r -> thread -> form_array}) + { + $v = $fdat->{$k} ; + if (defined ($v) && $v ne '') + { + $ok and $ok = $smtp->datasend("$k\t= $v \n" ); + } + } + $ok and $ok = $smtp->datasend("\nClient\t= $ENV{REMOTE_HOST} ($ENV{REMOTE_ADDR})\n\n" ); + $ok and $ok = $smtp->dataend() ; + $smtp->quit; + + $? = $ok?0:1 ; + + return $ok ; + } + + 1; @@ -238,4 +291,19 @@ =head1 DESCRIPTION + +You may override the following methods in your application object + +=over + +=item $app -> get_recipe ($r, $name) + +=item $app -> send_error_page ($r) + +=item $app -> mail_errors ($r) + +=item $app -> mail_form_to ($to, $subject, $returnfield) + +=back + 1.1.2.9 +10 -2 embperl/Embperl/Attic/Util.pm Index: Util.pm =================================================================== RCS file: /home/cvs/embperl/Embperl/Attic/Util.pm,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -r1.1.2.8 -r1.1.2.9 --- Util.pm 27 May 2002 17:53:13 -0000 1.1.2.8 +++ Util.pm 14 Oct 2002 05:05:46 -0000 1.1.2.9 @@ -43,6 +43,14 @@ ####################################################################################### +sub MailFormTo + + { + $Embperl::req -> app -> mail_form_to (@_) ; + } + +####################################################################################### + @AliasScalar = qw{row col cnt tabmode escmode req_rec maxrow maxcol req_rec dbgAll dbgAllCmds dbgCmd dbgDefEval dbgEarlyHttpHeader @@ -102,7 +110,7 @@ *{"$package\:\:sdat"} = $sess if ($sess) ; *{"$package\:\:exit"} = \&Embperl::exit ; - *{"$package\:\:MailFormTo"} = \&Embperl::MailFormTo ; + *{"$package\:\:MailFormTo"} = \&Embperl::Util::MailFormTo ; *{"$package\:\:Execute"} = \&Embperl::Req::ExecuteComponent ; tie *{"$package\:\:LOG"}, 'Embperl::Log' ; No revision No revision 1.1.2.1 +14 -0 embperl/test/cmp/Attic/mailformto.htm No revision No revision 1.1.2.6 +4 -0 embperl/test/cmp2/Attic/varerr.htm Index: varerr.htm =================================================================== RCS file: /home/cvs/embperl/test/cmp2/Attic/varerr.htm,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- varerr.htm 9 Oct 2002 06:46:15 -0000 1.1.2.5 +++ varerr.htm 14 Oct 2002 05:05:46 -0000 1.1.2.6 @@ -6,6 +6,10 @@ <tr bgcolor='#eeeeee'><td> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> ^^\[.*?\]ERR\: (32\: Warning|24\: Line \d+: Error) in Perl code\: Global symbol \"\;\$?d\"\; requires explicit package name at.*? +^^<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> +^^</td></tr> +^^<tr bgcolor='#eeeeee'><td> +^^<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> ^\[.*?\]ERR\: (32\: Warning|24\: Line \d+: Error) in Perl code\: Global symbol \"\;\$?e\"\; requires explicit package name at.*? <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> </td></tr> No revision No revision 1.1.2.1 +35 -0 embperl/test/html/Attic/mailformto.htm --------------------------------------------------------------------- To unsubscribe, e-mail: embperl-cvs-unsubscribe [at] perl For additional commands, e-mail: embperl-cvs-help [at] perl
|