20 May 2018 
Support Center » Knowledgebase » How do I set up a formmail cgi or other mail processor?
 How do I set up a formmail cgi or other mail processor?
Solution The first thing to know is that at Sustainable Hosting, we have disabled scripts named "mailform" or "formmail". There are bots that scan the web for files with these names and log their existance for later exploitation attempts. So, however you choose to process your mail forms, make sure that your processor is not named any combination of "form" and "mail".

We recommend the following solution:
Paste the following code into a file called "formproc.php" or something, in the same directory as your form acceptor page.

<?php
        $mailstr = "A web visitor has submitted the following info to your webform:\n\n";
        foreach ($_POST as $item => $itemvalue)
        {
                $mailstr .= $item . ": " . $itemvalue . "\n";
       }
        $mailstr .= "\n\nThank You!";
        $a = mail ("your@emailaddress.org","Web Form submission",$mailstr);
        header ("Location: http://www.yourhomepage.com");
?>
Be sure to replace "A web visitor...webform" with whatever you want your email intro line to be, "Web Form submission" with your desired email subject, and "Thank You!" with your desired email closure line.
Be EXTRA SURE to replace "your@emailaddress.org" with the email you'd like the submission to be sent to, and "www.yourhomepage.com" with whatever page address you'd like the surfer to be sent to after submission.

Important notes:
1. Your submission will be "from" an address that you can't control, but that will be the same all the time for everyone on the server. This is for security reasons (so that mail to: and from: addresses cannot be spoofed) and will not be changed.
2. In the program above, note that "\n" is turned into a new-line. This information can help you format your submissions.

We suggest that you start with the program as near as it is written here and test it. If you have trouble getting it to work, contact support. After it works in it's most basic form, you can start customizing it further.

Thank you!


Article Details
Article ID: 159
Created On: 05 Dec 2006 12:56 PM

 This answer was helpful  This answer was not helpful

 Back
 Login [Lost Password] 
Email:
Password:
Remember Me:
 
 Search
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | News
Language:

Help Desk Software By Kayako eSupport v3.50.06