perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject Re: Emailing the form data on submit
Date Fri, 21 May 2004 06:21:10 GMT
Take a look at
http://perl.apache.org/embperl/pod/doc/Embperl.-page-8-.htm#sect_37

Gerald


Sreeram_Bazaru@bankone.com wrote:
> In the example line [- MailFormTo ($MailTo,'Formdata','email') -] of
> eg/x/input.htm, is MailFormTo is a subroutine defined in Embperl and
> gets called automatically..? And What are the 'FormData' and 'email'
> parameters to the subroutine..? It is not running on my machine it
> says "Cannot connect to mailhost", may be something wrong with my
> machine's mail utility. So does this subroutine send all the formdata
> to the $MailTo email address..?
>
> Thanks,
> Sreeram
>
> -----Original Message-----
> From: Gerald Richter [mailto:richter@ecos.de]
> Sent: Wednesday, May 19, 2004 10:10 AM
> To: Lista Embperl; Bazaru, Sreeram (Card Services)
> Subject: Re: Emailing the form data on submit
>
>
> Luiz Fernando B. Ribeiro wrote:
>> On Mon, 17 May 2004 12:44:54 -0400, <Sreeram_Bazaru@bankone.com>
>> wrote:
>>
>>> Can I define a subroutine in embperl and call it when the submit
>>> button is clicked..? How do I do event handling in embperl (or
>>> modperl)..?
>>>
>
> Another example can be found in the Embperl distribution under
>
> eg/x/input.htm
>
> you also might take a look at Embperl::Mail which let you create
> mails by
> embeding Perl into the text
>
> Gerald
>
>
>>> Thanks,
>>> Sreeram
>>
>> Web applications are different from common apps. I will give you a
>> simple example but if you intend to build a more complex application
>> you will have to learn a lot more.
>>
>> In your Embperl page, test.epl:
>> [!
>> use Mail::Sendmail;
>> !]
>> [-
>> $req = shift;
>> -]
>>
>> <html>
>> ...
>>
>> [$ if ( $fdat{send} ) $]
>> [-
>> %email = (
>> To => "me@provider.com",
>> From => "mailer@site.com",
>> Subject => "Form data",
>> Body => "New post:\n\nName: $fdat{Name}\nAge: $fdat{Age}",
>> );
>> -]
>> [$ if ( sendmail(%email) ) $]
>> <p>Thanks [+ $fdat{Name} +]</p>
>> [$ else $]
>> <h2>Sorry, could not deliver your message</h2>
>> [$ endif $]
>>
>>
>> [$ else $]
>>
>> <form action="test.epl">
>> Name: <input type="text" name="Name" />
>> Age: <input type="text" name="Age" />
>> <input type="submit" name="send" value="Send now" />
>> </form>
>>
>> [$ endif $]
>> ...
>> </html>
>>
>>
>>> -----Original Message-----
>>> From: Luiz Fernando B. Ribeiro [mailto:luiz@engenhosolucoes.com.br]
>>> Sent: Monday, May 17, 2004 12:24 PM
>>> To: Lista Embperl
>>> Subject: Re: Emailing the form data on submit
>>>
>>>
>>> On Mon, 17 May 2004 10:26:24 -0400, <Sreeram_Bazaru@bankone.com>
>>> wrote:
>>>
>>>> Hello,
>>>> Is there any way to email the form data on submit either in embperl
>>>> or
>>>>> modperl..? I appreciate your help.
>>>>
>>>
>>> The form data is available to you in %fdat so you can use any module
>>> from CPAN to send an e-mail, do it by hand or open a pipe to
>>> sendmail or mail.
>>>
>>>  From CPAN the easiest modules are Mail::Sendmail (for simple
>>> messages) and MIME:Lite (for more options, like attachments).
>>>
>>> Embperl has a bult-in feature for doing this but I am not familiar
>>> with it, try reading the manual pages for this.
>>>
>>> Good luck,
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
>> For additional commands, e-mail: embperl-help@perl.apache.org
>
> --------------------------------------------------------------------------
-
> Gerald Richter            ecos electronic communication services gmbh
> IT-Securitylösungen * Webapplikationen mit
> Apache/Perl/mod_perl/Embperl
>
> Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
> E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
> WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
> --------------------------------------------------------------------------
-
> Besuchen Sie uns auf der KOMCOM 2004 in Mannheim
> 25. bis 27. Mai 2004  Stand K11a   www.komcom.de
>
> ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
> --------------------------------------------------------------------------
-
>
>
>
> **********************************************************************
> This transmission may contain information that is privileged,
> confidential and/or exempt from disclosure under applicable law. If
> you are not the intended recipient, you are hereby notified that any
> disclosure, copying, distribution, or use of the information
> contained herein (including any reliance thereon) is STRICTLY
> PROHIBITED. If you received this transmission in error, please
> immediately contact the sender and destroy the material in its
> entirety, whether in electronic or hard copy format. Thank you
> **********************************************************************

---------------------------------------------------------------------------
Gerald Richter            ecos electronic communication services gmbh
IT-Securitylösungen * Webapplikationen mit Apache/Perl/mod_perl/Embperl

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
---------------------------------------------------------------------------
Besuchen Sie uns auf der KOMCOM 2004 in Mannheim
25. bis 27. Mai 2004  Stand K11a   www.komcom.de

ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
---------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message