Summary: Talk page for Mailform3.
Maintainer: TonyColley
Users: (View? / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.


Sept. 23, 2006 I love this recipe, and for the most part it works great, but I have run into a Spam problem. I receive the e-mails but they do not include the senders ip address as promised. The bottom of the e-mail reads:

<hr>Sender's IP address:

Please help! I am using the default configuration with version 2.1.26 of PmWiki. Profiles/MattKemple

Thanks for this recipe, I love the inpage success message. I also solved the IP issue message. On a Linux Apache system $REMOTE_ADDR isn't working Both occurrences in the script should replaced with: $_SERVER['REMOTE_ADDR'] Then things work as expected.

Have fun, Bart October 06, 2006, at 10:17 AM

Bart, Thanks for the help this seems to have remedied the problem. -Matt Oct. 19, 2006

UPDATE 05 AUG 2007 I have uploaded a slightly modified version of the PHP file which takes care of the REMOTE_ADDR problem. TonyColley

Hello, well, I tried mailform, 1, 2, 3, and I am not completely satisfied...

I can't code in php, so if somebody can help me and contribute for the community with a mailform4 it should be fine!-)

What I would like is: a mailform4.php which allows to create a free form with as much form fields as needed. By example, if the user needs 3 fields or 10 fields mailform4 will take in account these 3 or 10 fields and send all the informations to the mailformaddress.

I give an example of php script which does what I describe above and works fine in html context (but don't in wiki context). If this can inspire the future contributor... Thanks!!!

$TO = "your@emailaddress";
$h = "From: " . $TO;
$message = "";
while (list($key, $val) = each($HTTP_POST_VARS))
{$message .= "$key : $val\n";}
mail($TO, $subject, $message, $h);
Header("Location: [(approve links) edit diff]");

If this script can manage too hidden variables (for sending informations about the origin and purpose of the form), and if a simple test can block the sending when a field is empty, all should be great!

How can one add more message fields, e.g. for a support-request form (Message-detail, Message-options, etc)? Thanks, JanBrejcha

I have added extra message fields (in the example below, for an address and telephone number) in my own wiki. Steps are as follows:
1. In my local/Main.ContactUs.php script, I added the following extra lines after ~line 64:
            $laddress = $_POST["address"];
            $ltelephone = $_POST["telephone"];
2. Further down this same script, I added the following lines:
            $bd .= "\nAddress: ".$laddress;
            $bd .= "\nTelephone: ".$ltelephone;
3. In my Main/ContactMe page, I added in the required extra fields into the contact form table:
            ||Address:||(:input textarea name="address" rows="5" cols="50":)||
            ||Telephone:||(:input text name="telephone" size="50":)||
This seemed to work for me, and the additional fields are coming through. My only concern is the security of my extra additions. Anyone have any thoughts? IDB

Adding a Spam bot protection using PM's Captcha receipe

I like this mailform a lot. When I found PM's Captcha receipe I thought that it would be nice to use it in this mailform, which can be done easily in a few steps:
Download captcha.php, copy it into the cookbook/ directory, and include it in your 'local/config.php' as described in PM's receipe. (The $EnablePostCaptchaRequired is not required here.)
In the Main.ContactMe.php you insert the following after line 75

 else if (!IsCaptcha()) {
   $msg = "Empty or wrong code. ";
   $snt = "false";
   $frm = "true";

and in the Main.ContactMe.txt you replace line 29 || (:input submit value="Send Message":) ||||
||Enter code: {$Captcha} (:input captcha:) (:input submit value="Send Message":) ||||
That is all, now it should work fine.

But I have also a question: Is it possible to keep the message text? When I hit the send button and the mail was for some reason not sent, the name and the mailadress I typed reappear in their forms, but the message form is empty.

FH February 14, 2008, at 06:09 AM

Fabrizio February 23, 2009,

I tried this using Mailform3 following all the instructions but it does not work

Talk page for the Mailform3 recipe (users?).