Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

FormMail.pl Help

by focus310 (Novice)
on Feb 14, 2006 at 11:53 UTC ( [id://530101]=perlquestion: print w/replies, xml ) Need Help??

focus310 has asked for the wisdom of the Perl Monks concerning the following question:

Hello: I'm new here. I'm using FormMail.pl for the first time.

I want to send a confirmation email to the person who submitted the form. I enabled the $send_confirmation_mail to 1 and I'm receiving the confirmation.

I want to include the results of the form fields in the body of this confirmation email. I can't seem to figure out how to do it.

Can someone help me out? Thank you in advance.

Here is the section of the FormMail.pl where I need to stick the form field results (I have three: name, email, and phone):

BEGIN { $DEBUGGING = 1; $emulate_matts_code= 0; $secure = 1; $allow_empty_ref = 1; $max_recipients = 5; $mailprog = '/usr/sbin/sendmail -oi -t'; $postmaster = ''; @referers = qw(fullfocusdesign.com); @allow_mail_to = qw(info@fullfocusdesign.com); @recipients = (); %recipient_alias = (); @valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USE +R_AGENT); $locale = ''; $charset = '/usr/sbin/sendmail -oi -t'; $date_fmt = '/usr/sbin/sendmail -oi -t'; $style = '/usr/sbin/sendmail -oi -t'; $no_content = 0; $double_spacing = 1; $wrap_text = 0; $wrap_style = 1; $send_confirmation_mail = 1; $confirmation_text = <<'END_OF_CONFIRMATION'; From: info@fullfocusdesign.com Subject: form submission Thank you for your form submission. Here is the info you submitted: <b>stick field results here</b> END_OF_CONFIRMATION # You may need to uncomment the line below and adjust the path. # use lib './lib'; # USER CUSTOMISATION SECTION # -------------------------- # Place any custom code here # USER CUSTOMISATION << END >> # ---------------------------- # (no user serviceable parts beyond here) }

Replies are listed 'Best First'.
Re: FormMail.pl Help
by davorg (Chancellor) on Feb 14, 2006 at 13:38 UTC

    You can't just say "formmail" and expect everyone to know what you mean. There are dozens of programs on the web which are called "formmail". You need to be more specific about where the program comes from.

    This looks a lot like the nms formmail so I think I can comment on your problem but you should probably use the support email address (nms-cgi-support@lists.sourceforge.net) in the future to get support from people who know the nms formmail well.

    There are two good rules of thumb when sending email from a web form - only send variable content to a fixed email address and only send fixed content to a variable email address. If you allow people to send data from the form to an email address which is also taken from the form then you have a program that can be used to send spam. The nms developers have done all we can to prevent our program from being able to send spam. Therefore you cannot send form data to in the confirmation email. To allow that would be to allow your web server to send spam for anyone who wanted to use it. And I hope that you don't want that.

    And whilst I'm looking at your code, these lines are completely wrong:

    $charset = '/usr/sbin/sendmail -oi -t'; $date_fmt = '/usr/sbin/sendmail -oi -t'; $style = '/usr/sbin/sendmail -oi -t';

    You're probably better off reverting them to what they were in the original version that you downloaded.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      Thank you all for the reply. My question is definately answered. I most certainly do not want to have my form be used to SPAM innocent people. I'm leaving it as is.
Re: FormMail.pl Help
by mk. (Friar) on Feb 14, 2006 at 14:00 UTC
    it's been ages since i last used formmail scripts, but i remember something like the fields being saved in a hash called %Form, so if you want to print them you could maybe use foreach $field(sort keys %Form) {print $field.": ".$Form{$field}."<br  />"}
    but your script might be different from the ones i used, since there are so many out there. why don't you post the entire code so we can take a look at it?!
    =)


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    @
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://530101]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-03-28 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found