simple_cgi_email - A simple script to send email from an HTML form submission. simple_cgi_email is meant to provide a quick-n-dirty way to send email from an HTML form. Its output is fairly unpleasant to look at, certainly not suitable for clients or anyone else who cares about the format of their emails, but it's perfect for small feedback forms, contact forms, registration forms, etc. simple_cgi_email was written by Sam Clippinger (samc@lookandfeel.com) and is based on LAFmessage, a generic messaging library produced by lookandfeel new media. simple_cgi_email and LAFmessage are both available from lookandfeel's free software site at: http://freesoftware.lookandfeel.com/ INSTALLATION ============ simple_cgi_email compiles and runs on Win32 and Linux. Compiling on Win32 requires Microsoft Visual C++ 6.0 or higher. The DSP file should load the entire project. After adjusting the output paths to suit your environment, the project should compile without errors (the default output file is E:\Projects\Output\simple_cgi_email.exe). Compiling on Linux requires GNU g++. Simply running "make" should produce an executable in the project directory named "simple_cgi_email". If you get a million syntax errors, it's possible that the source files were last saved in DOS format (lines end in CRLF) instead of Unix format (lines end in LF). To correct this, run "make reformat", then "make" again. To remove all of the intermediate and output files, run "make clean". On both platforms, you must copy the executable file to a directory from which the web server can run it as a CGI script. USAGE ===== simple_cgi_email expects at least five parameters in the query string. They are: from_address - The address the message should appear to come from. smtp_server - The name or IP address of the SMTP server to use. success_file - The HTML file to display to the user upon success. subject - The subject of the message. to_address - The address the message should be delivered to. simple_cgi_email will optionally accept four more parameters in the query string. They are: failure_file - The HTML file to display to the user upon failure. from_name - The name the message should appear to come from. smtp_port - The port number to use on the SMTP server. Defaults to 25. to_name - The name the message should be delivered to. All other parameters passed through the query string will be ignored. All variables passed through POSTed content will be used to create the message body. An example HTML file that uses simple_cgi_email follows: ............................................................
............................................................ When the form is loaded and the button is clicked, the following email would be generated (some headers omitted for clarity): ............................................................ To: Mr. Bar