- header('Content-type: text/plain');
- print "e-mailing this: \n\n";
- tem_output('~form_name~.email.txt');
+ if($GLOBALS['~form_name~_form_recipient'] != "fixme@example.com") {
+ $to = $GLOBALS['~form_name~_form_recipient'];
+ if(isset($_REQUEST['email']) and valid_email($_REQUEST['email'])) {
+ $from = $_REQUEST['email'];
+ if($_REQUEST['name'] and ereg('^[a-zA-Z0-9_\' -]*$', $_REQUEST['name']) !== false) {
+ $from = "$_REQUEST[name] <$from>";
+ }
+ } else {
+ $from = $to;
+ }
+ $subject = '~form_name~ form submitted';
+ $message = tem_run('~form_name~.email.txt');
+ $cc = '';
+ $bcc = '';
+ email($from, $to, $subject, $message, $cc, $bcc);
+ }
+ tem_load('~form_name~.html');
+ tem_sub('thankyou');
+ tem_output();