Join 105,772 PHP Programmers for FREE! Ask your question and get quick answers from experts. There are 1,382 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!
UK based hosting company Streamline.net upgraded its php5 functions recently and suddenly all forms (developed with coffecup form builder) of my 30+ clients have stopped working !! :-( Streamline state a fifth parameter needs to be included in the php code. There response to me was: Send mail path /usr/sbin/sendmail -fuser\@yourdomain.co.uk You need to replace -fuser\@domain.co.uk with a valid mailbox on your account: i.e) -froot\@domain.co.uk An example of how to use this is as follows: mail($to, $sub, $mess, "From: root@domain.co.uk", "-froot@domain.co.uk");
The strange thing is my own website form is working ok!! just my clients sites, very odd. They were all working fine before streamline cocked the webserver up. Any advice on if and how it may be possible to get the forms working. Please PHP Gurus it would be appriciated so so much. Sorry the code is a little long winded! Any help on how and where I could fix this would be great.
Thanks in advance Phil Brighton p.s Here is a URL to show a form, http://www.secret-garden-york.co.uk its a little naff but you can see it looks like it has submitted but the info never gets to the streamline webmail account. By the way, if I send to a form to a hotmail account it works fine! Double grrrrr!!
Here is the php code of a form:
CODE
<?php /** * CoffeeCup Flash Form Builder: Form Results Handler * * This file is in charge of handling the form results * posted from the CoffeeCup Flash Form Builder SWF. * It has several primary functions: * * - Assure that the user is running the proper version of * PHP and has properly configured their server for * CoffeeCup Flash Form Builder by uploading the provided * files and assigning the appropriate server settings * and permissions. * - Upload a file if the '$_FILES['Filedata']' variable is * populated * - If the '$_POST' superglobal array has been populated, * process the form by: * - Reading the config file provided in the '$_POST['xmlfile']' * variable. * - Saving the form data to a file if the 'CC_FB_SAVE_FILE' constant * has been populated. * - Saving the form data to the database provided in 'CC_FB_DB_ADDRESS' * if the 'CC_FB_DB_ADDRESS' constant is populated. * - Emailing the form data to the form owner via the address provided * in the '$_POST['_ALT_EMAIL']' variable or the '$_POST['mailto']' * variable if the '$_POST['_ALT_EMAIL']' variable is not populated. * - Emailing the form data to the form user via the address provided in * the '$_POST['eM']' variable if the '$_POST['eM']' variable has been * populated and the 'emailuser' config option is set to 'true'. * - Taking the form user to the landing page provided in the * '$_POST['thankyoupage']' variable or to a default landing page * if the '$_POST['thankyoupage']' is empty. * - Prints out an informational page with version numbers and release * dates if an error occurs or if this script is called without * the '$_POST' superglobal or the '$_FILES['Filedata']' variables * being set. * * @license [url=http://www.coffeecup.com/legal/eula.html]http://www.coffeecup.com/legal/eula.html[/url] * @author Jeff Welch <jw@coffeecup.com> * @version 4.0 * @package CC_FB */
// Error reporting should be disabled in favor of // our customer error messages. error_reporting(0);
/** * The version of CoffeeCup Flash Form Builder that * generated this script. */ define('CC_FB_VERSION', '7.1'); /** * The release date of the version of CoffeeCup Flash Form * Builder that generated this script. */ define('CC_FB_LAST_UPDATED', '08/31/2007');
/** * The version of this script. */ define('CC_FB_SCRIPT_VERSION', '4.0'); /** * The release date of this script. */ define('CC_FB_SCRIPT_LAST_UPDATED', '09/07/2007');
/** * The required PHP version for this script. */ define('CC_FB_PHP_VERSION', '4.3.0');
/** * Will the owner of this form be emailed the * form data */ define('CC_FB_DO_EMAIL',true); /** * To default To address. */ define('CC_FB_TO_EMAIL', 'root@secret-garden-york.co.uk'); /** * The default CC address. */ define('CC_FB_CC_EMAIL', ''); /** * The default BCC address. */ define('CC_FB_BCC_EMAIL', '');
/** * If we should send a message back to the user. */ define('CC_FB_AUTO_REPLY', false); /** * The subject of the message to be sent to the user. */ define('CC_FB_AUTO_REPLY_SUBJECT', ''); /** * If we should include the form results * in the message we send to the user. */ define('CC_FB_AUTO_REPLY_FORM_RESULTS', false); /** * The position of the auto-reply message * in the email. */ define('CC_FB_AUTO_REPLY_POSITION', 'bottom');
/** * The page to redirect to after the form is submitted. */ define('CC_FB_RESULTS_REDIRECT', 'http://www.secret-garden-york.co.uk/thanks.htm');
/** * The address of the database where the form results * will be saved. */ define('CC_FB_DB_ADDRESS', '[ADDRESS]'); /** * The port number of the database where the form results * will be saved. */ define('CC_FB_DB_PORT', '[DBPORT]'); /** * The username for the database where the form results * will be saved. */ define('CC_FB_DB_USERNAME', '[DBUSER]'); /** * The password for the database where the form results * will be saved. */ define('CC_FB_DB_PASSWORD', '[DBPASS]'); /** * The name of the database where the form results * will be saved. */ define('CC_FB_DB_NAME', '[DBNAME]');
/** * The file to log the form results to if necessary. */ define('CC_FB_SAVE_FILE', '[FILENAME]');
/** * The filetypes that are acceptable for file uploads. */ define('CC_FB_ACCEPTABLE_FILE_TYPES', 'txt|gif|jpg|jpeg|zip|doc|png|pdf|rtf'); /** * The directory where files are uploaded */ define('CC_FB_UPLOADS_DIRECTORY', 'files'); /** * The extension that gets added to file uploads */ define('CC_FB_UPLOADS_EXTENSION', '_fbu'); /** * Will we save the file uploads to the server */ define('CC_FB_ATTACHMENT_SAVETOSERVER',true); /** * Will we save the file uploads to the db */ define('CC_FB_ATTACHMENT_SAVETODB',false); /** * Will we send the file upload as an attachment */ define('CC_FB_ATTACHMENT_ADDTOEMAIL',false); /** * Sendmail Message EOL's */ define('CC_FB_SENDMAIL_EOL',"\r\n");
// Makes sure that the user is using the required version // of PHP as specified by {@link CC_FB_PHP_VERSION}. if(!version_compare(PHP_VERSION, CC_FB_PHP_VERSION, '>=')) { printMessage('Invalid PHP Version', "We're sorry but CoffeeCup Form Builder requires PHP version " . CC_FB_PHP_VERSION . ' or greater. Please contact your server ' . 'administrator.'); } // Strip slashes if the server has magic quotes enabled. if(get_magic_quotes_gpc()) { $_POST = array_map("stripslashes", $_POST); } // John will need to fix this in the swf file. foreach($_POST as $key => $value) { $_POST[str_replace('_', ' ', $key)] = $value; }
// If the '$_FILES['Filedata']' is populated, process the // file upload. if(isset($_FILES['Filedata'])) { processFileUpload(); } // If the '$_POST' superglobal array is populated, // process the form results. elseif(is_array($_POST) && count($_POST) > 0) { processMailForm(); } // If all else fails, print out a blank page with version // numbers and release dates. printMessage();
/** * Process the mail form results. * * This method is in charge of processing the mail form which * is posted from the CoffeeCup Flash Form Builder SWF. This * process includes: * * - Retrieving the preferences from the included CoffeeCup Flash * Form Builder XML preferences file. * - Formats output for file output as well as for an email to * the form user and the form owner as necesarry. * - Writes output to a file and sends it to the form user and * the form owner as necessary. * - Writes form results to a database if necesarry. */ function processMailForm() { fixUploadedFileName(); $preferences = getPreferences();
// Make sure we delete the file from the server if the user doesn't // want it if(!CC_FB_ATTACHMENT_SAVETOSERVER && $_POST['Uploaded_File'] != '') { @unlink(CC_FB_UPLOADS_DIRECTORY . "/{$_POST['Uploaded_File']}"); }
/** * Send response emails to the appropriate recipients. * * Sends an email to the scripts owner as well as the end-user * if appropriate. If the sending of mail fails, an error * message will be printed out to the screen. * * @param string $email_response the default contents to mail to the user. * @param array $preferences the CoffeeCup Flash Form Builder Preferences. */ function sendResponseEmails($email_response, $preferences) { // If the program is unregistered, add the unregistered message. if($_POST['unreg']) { $unreg = "------------------------" . CC_FB_SENDMAIL_EOL . CC_FB_SENDMAIL_EOL . "This Form was sent to you using CoffeeCup Form Builder." . CC_FB_SENDMAIL_EOL . "Please tell a " . "friend about us: [url=http://www.coffeecup.com/form-builder/";]http://www.coffeecup.com/form-builder/";[/url] }
// Set up the CC field if necessary if(CC_FB_CC_EMAIL != '') { $cc = 'Cc: ' . CC_FB_CC_EMAIL . CC_FB_SENDMAIL_EOL; }
// Set up the BCC field if necessary if(CC_FB_BCC_EMAIL != '') { $bcc = 'Bcc: ' . CC_FB_BCC_EMAIL . CC_FB_SENDMAIL_EOL; }
// Use the alternative email if one is provided $mail_to = ($_POST['_ALT_EMAIL'] != '' ? $_POST['_ALT_EMAIL'] : CC_FB_TO_EMAIL);
// Set a default subject if one is not provided provided $subject = ($_POST['subject'] != '' ? $_POST['subject'] : 'Form Submission');
// Set up the default mail headers $headers = 'MIME-Version: 1.0' . CC_FB_SENDMAIL_EOL . 'Content-Type: text/plain; charset=utf-8' . CC_FB_SENDMAIL_EOL . 'Content-Transfer-Encoding: 7bit' . CC_FB_SENDMAIL_EOL;
// Set up the default owner message $form_owner_msg = 'Here is the information submitted to ' . "{$_SERVER['SERVER_NAME']}{$_SERVER['PHP_SELF']} from " . "{$_SERVER['REMOTE_ADDR']} on " . date("l, F dS, Y \a\\t g:i a") . "." . CC_FB_SENDMAIL_EOL . "------------------------" . CC_FB_SENDMAIL_EOL . "$email_response$unreg" . CC_FB_SENDMAIL_EOL. CC_FB_SENDMAIL_EOL;
// Add the uploaded file as an attachment if the user has // request we do so if(CC_FB_ATTACHMENT_ADDTOEMAIL && $_POST['Uploaded_File'] != '') { if(!($contents = file_get_contents(CC_FB_UPLOADS_DIRECTORY . "/{$_POST['Uploaded_File']}"))) { printMessage('Unable To Open Attachment File',"We're sorry but " . 'we were unable to open your uploaded file to attatch it for ' . 'email. Please be sure that you have the proper permissions.'); }
// Setup the unique mime boundary $mime_boundary = md5(time());
// Set up the form owner mail headers $form_owner_headers = 'MIME-Version: 1.0' . CC_FB_SENDMAIL_EOL . 'Content-Type: multipart/mixed; ' . "boundary=\"$mime_boundary\"" . CC_FB_SENDMAIL_EOL. CC_FB_SENDMAIL_EOL;
// If we collected the end-user's email if($_POST['eM']) { // Send a message to the form's owner with the end-user's email // as the reply-to address. if(CC_FB_DO_EMAIL && !(mail($mail_to,$subject, $form_owner_msg, "Reply-To: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "Return-Path: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "From: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "$cc$bcc" . 'Message-ID: <' . time() . "-{$_POST['eM']}>" . CC_FB_SENDMAIL_EOL . 'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL . $form_owner_headers))) { printMessage('Unable To Send E-Mail', "We're sorry but we were unable to send your e-mail. " . 'If you are sure that you entered all your email ' . 'addresses properly, you should contact your server ' . 'administrator.'); }
// If necesarry, send a message to the end-user as well. if(CC_FB_AUTO_REPLY) { $auto_reply_msg = '';
mail($_POST['eM'],CC_FB_AUTO_REPLY_SUBJECT, "$form_user_msg$unreg", "Reply-To: $mail_to" . CC_FB_SENDMAIL_EOL . "Return-Path: $mail_to" . CC_FB_SENDMAIL_EOL . "From: $mail_to" . CC_FB_SENDMAIL_EOL . 'Message-ID: <' . time() . "-$mail_to>" . CC_FB_SENDMAIL_EOL . 'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL . $headers); } } // Send a message to the form's owner. elseif(CC_FB_DO_EMAIL && !(mail($mail_to,$subject, $form_owner_msg, 'From: CoffeeCup Flash Form Builder ' . "<formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL . "$cc$bcc" . 'Message-ID: <' . time() . "-formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL . 'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL . $form_owner_headers))) { printMessage('Unable To Send E-Mail', "We're sorry but we were unable to send your e-mail. " . 'If you are sure that you entered all your email ' . 'addresses properly, you should contact your server ' . 'administrator.'); } }
/** * Gets the real name of the file that was uploaded. * * Since the file upload occurs in a different request, * this method helps us resolve what the name of the * uploaded file was in case it was renamed. */ function fixUploadedFileName() { if($_POST['Uploaded_File'] != '') { $extension = substr($_POST['Uploaded_File'], strrpos($_POST['Uploaded_File'], '.')); $basename = basename($_POST['Uploaded_File'], $extension);
/** * Write form response to a database. * * Writes the form response to the database specified at 'CC_FB_DB_ADDRESS' * if appropriate. If the database doesn't it exist, the form_results * table doesn't exist or if the form_results table doesn't comply with * the structure of the current form then the database will be restructured * accordingly. * * @param array $preferences the CoffeeCup Flash Form Builder Preferences. */ function writeResponseToDatabase($preferences) { // If the CC_FB_DB_ADDRESS constant has been populated, then // the user wants to write their data to a database. if(CC_FB_DB_ADDRESS != '[ADDRESS]') { // First and foremost, lets make sure they have the mysql extension // loaded. if(!extension_loaded('mysql')) { printMessage('Unable to use MySQL', "We're sorry but you must have the MySQL extensions loaded " . 'in your PHP configuration in order to save your form '. 'results to a MySQL database. Please contact your ' . 'server administrator.'); } // Secondly, lets make sure we can connect to their database. elseif(!($link = mysql_connect(CC_FB_DB_ADDRESS . ':' . CC_FB_DB_PORT, CC_FB_DB_USERNAME, CC_FB_DB_PASSWORD))) { printMessage('Unable to Connect to Database Server.', "We're sorry but we were unable to connect to your database " . 'server. Please be sure you have entered your database ' . 'settings correctly.'); } // If we can't select their DB, lets try to create our own. elseif(!mysql_select_db(CC_FB_DB_NAME, $link)) { if(!mysql_query('CREATE DATABASE ' . CC_FB_DB_NAME, $link)) { printMessage('Unable to Create Database.', "We're sorry but we were unable to create your database. " . 'If you believe the database already exists, please ' . 'be sure that you have the proper permissions to ' . 'select it. Otherwise, please be sure that you ' . 'have permissions to create databases. If you ' . 'are still experiencing troubles, please contact ' . 'your server administrator.'); } elseif(!mysql_select_db(CC_FB_DB_NAME, $link)) { printMessage('Unable to select Database.', "We're sorry but we were unable to select your database. " . 'Please be sure that you have the proper permissions to ' . 'select it. If you are still experiencing trouble, ' . 'please contact your server administrator.'); } }
// If a form_results table exists, make sure it is in the // proper format. if(mysql_num_rows(mysql_query("SHOW TABLES LIKE 'form_results'", $link)) != 0) { if(!($results = mysql_query('SHOW COLUMNS FROM `form_results`', $link))) { printMessage('Unable to Query Database.', "We're sorry but we were unable to query your database " . 'table. Please be sure that you have the proper ' . 'permissions to select from the form_results ' . 'table. If you are still experiencing trouble, ' . 'please contact your server administrator.'); }
if(!formFieldsEqualsTableFields($preferences['form_fields'], $columns)) { archiveOldTable($link); createTableFromFormFields($preferences['form_fields'], $link); } } // Otherwise create the form_results table in the proper format. else { createTableFromFormFields($preferences['form_fields'], $link); }
// If all went well, lets attempt to write the form results to // the database. foreach($preferences['form_fields'] as $field_name => $field) { $query .= "`$field_name` = " . mysqlEscape($_POST[$field_name], $link) . ','; }
// Add the uploaded file to the query if necessary if(CC_FB_ATTACHMENT_SAVETODB) { if($_POST['Uploaded_File'] != '') { if(!($contents = file_get_contents(CC_FB_UPLOADS_DIRECTORY . "/{$_POST['Uploaded_File']}"))) { printMessage('Unable To Open Attachment File',"We're sorry " . 'but we were unable to open your uploaded file to ' . 'attach it for email. Please be sure that you have the ' . 'proper permissions.'); }
if(!mysql_query('INSERT INTO `form_results` SET ' . $query . "`created_at` = NOW()", $link)) { printMessage('Unable to Insert Into Database Table.', "We're sorry but we were unable to insert the form results " . 'into your database table. Please be sure that you have ' . 'the proper permissions to insert data into the ' . 'form_results table. If you are still experiencing ' . 'trouble, please contact your server administrator.'); } } }
/** * Archives an old `form_results` table. * * Renames a form results table to form_results_old or * form_results_old with a numerical value on the end of it * if appropriate. * * @param resource $link a database resource */ function archiveOldTable($link) { while(mysql_num_rows(mysql_query("SHOW TABLES LIKE 'form_results_old$i'", $link)) != 0) { $i++; }
if(!(mysql_query("RENAME TABLE `form_results` TO `form_results_old$i`", $link))) { printMessage('Unable to Rename Database Table.', "We're sorry but we were unable to rename your database " . 'table. Please be sure that you have the proper ' . 'permissions to rename the form_results table. If you ' . 'are still experiencing trouble, please contact your ' . 'server administrator.'); } }
/** * Escapes a value for MySQL. * * Prepares a value to be used safely in a MySQL query. If the value is * numeric, it is returned. If the value is a string, it is quoted and * escaped using the mysql_real_escape_string function. * * @param mixed $value the value to be escaped * @param resource $link a database resource * @return mixed $value the escaped value */ function mysqlEscape($value, $link) { return ("'" . mysql_real_escape_string($value, $link) . "'"); }
/** * Checks if the columns from a table match the the structure * of the fields from a form. * * @param array $form_fields the structure from the form * @param array $table_fields the structure from the table * @return boolean $value, true if the structures are the same, * false if the structures are not. */ function formFieldsEqualsTableFields($form_fields, $table_fields) { // Make sure we have the proper fields for saving uploaded // files to the database if the user has requested we do so if(CC_FB_ATTACHMENT_SAVETODB) { if(array_key_exists('uploaded_file', $table_fields) && array_key_exists('uploaded_file_name', $table_fields)) { unset($table_fields['uploaded_file_name']); unset($table_fields['uploaded_file']); } else { return false; } }
There are three places I identified that you would need to change to add in this extra 5th parameter. Below I have posted five pieces of code that you must identify in the code you posted (They are all about half way through the script and are one right after the other) and add in an extra line I have identified in red.
Segment 1...
CODE
// If we collected the end-user's email if($_POST['eM']) { // Send a message to the form's owner with the end-user's email // as the reply-to address. if(CC_FB_DO_EMAIL && !(mail($mail_to,$subject, $form_owner_msg, "Reply-To: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "Return-Path: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "From: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "$cc$bcc" . 'Message-ID: <' . time() . "-{$_POST['eM']}>" . CC_FB_SENDMAIL_EOL . 'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL . $form_owner_headers[color=#FF0000], "-f$mail_to"[/color]))) { printMessage('Unable To Send E-Mail', "We're sorry but we were unable to send your e-mail. " . 'If you are sure that you entered all your email ' . 'addresses properly, you should contact your server ' . 'administrator.'); }
// Send a message to the form's owner. elseif(CC_FB_DO_EMAIL && !(mail($mail_to,$subject, $form_owner_msg, 'From: CoffeeCup Flash Form Builder ' . "<formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL . "$cc$bcc" . 'Message-ID: <' . time() . "-formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL . 'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL . $form_owner_headers[color=#FF0000], "-f$mail_to"[/color]))) { printMessage('Unable To Send E-Mail', "We're sorry but we were unable to send your e-mail. " . 'If you are sure that you entered all your email ' . 'addresses properly, you should contact your server ' . 'administrator.');
Now essentially what I have done here is tracked down everywhere in that script that uses the mail function and added the 5th parameter which, according to the ISP, needs to consist of the -f switch followed by the email address of the sender. In this case it appears the sender is located in the $mail_to variable.
So in theory this should work for you if the email address in $mail_to is an actual working email address... which should be since you said you have sent mail before with this until they upgraded.
So give it a shot and see what happens. Make sure you have clearly identified these areas and made only the changes I have shown above. You might have to come back to these sections if this fix doesn't work.
If it doesn't work, be sure to report any error messages you receive. Thanks for helping me help you.
Thank you very much for your reply. I have put in these parameters but still no luck. The form seems to submit, but no data is collected in the webmail account. Its a real pain to say the least. Any other ideas appriciated. Thanks
Phil
QUOTE(Martyr2 @ 26 Apr, 2008 - 11:56 AM)
There are three places I identified that you would need to change to add in this extra 5th parameter. Below I have posted five pieces of code that you must identify in the code you posted (They are all about half way through the script and are one right after the other) and add in an extra line I have identified in red.
Segment 1...
// If we collected the end-user's email if($_POST['eM']) { // Send a message to the form's owner with the end-user's email // as the reply-to address. if(CC_FB_DO_EMAIL && !(mail($mail_to,$subject, $form_owner_msg, "Reply-To: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "Return-Path: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "From: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "$cc$bcc" . 'Message-ID: <' . time() . "-{$_POST['eM']}>" . CC_FB_SENDMAIL_EOL . 'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL . $form_owner_headers, "-f$mail_to"))) { printMessage('Unable To Send E-Mail', "We're sorry but we were unable to send your e-mail. " . 'If you are sure that you entered all your email ' . 'addresses properly, you should contact your server ' . 'administrator.'); }
// Send a message to the form's owner. elseif(CC_FB_DO_EMAIL && !(mail($mail_to,$subject, $form_owner_msg, 'From: CoffeeCup Flash Form Builder ' . "<formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL . "$cc$bcc" . 'Message-ID: <' . time() . "-formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL . 'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL . $form_owner_headers, "-f$mail_to"))) { printMessage('Unable To Send E-Mail', "We're sorry but we were unable to send your e-mail. " . 'If you are sure that you entered all your email ' . 'addresses properly, you should contact your server ' . 'administrator.');
Now essentially what I have done here is tracked down everywhere in that script that uses the mail function and added the 5th parameter which, according to the ISP, needs to consist of the -f switch followed by the email address of the sender. In this case it appears the sender is located in the $mail_to variable.
So in theory this should work for you if the email address in $mail_to is an actual working email address... which should be since you said you have sent mail before with this until they upgraded.
So give it a shot and see what happens. Make sure you have clearly identified these areas and made only the changes I have shown above. You might have to come back to these sections if this fix doesn't work.
If it doesn't work, be sure to report any error messages you receive. Thanks for helping me help you.
QUOTE(philb @ 26 Apr, 2008 - 12:25 PM)
Hi Martyr2
Thank you very much for your reply. I have put in these parameters but still no luck. The form seems to submit, but no data is collected in the webmail account. Its a real pain to say the least. Any other ideas appriciated. Thanks
Phil
QUOTE(Martyr2 @ 26 Apr, 2008 - 11:56 AM)
There are three places I identified that you would need to change to add in this extra 5th parameter. Below I have posted five pieces of code that you must identify in the code you posted (They are all about half way through the script and are one right after the other) and add in an extra line I have identified in red.
Segment 1...
// If we collected the end-user's email if($_POST['eM']) { // Send a message to the form's owner with the end-user's email // as the reply-to address. if(CC_FB_DO_EMAIL && !(mail($mail_to,$subject, $form_owner_msg, "Reply-To: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "Return-Path: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "From: {$_POST['eM']}" . CC_FB_SENDMAIL_EOL . "$cc$bcc" . 'Message-ID: <' . time() . "-{$_POST['eM']}>" . CC_FB_SENDMAIL_EOL . 'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL . $form_owner_headers, "-f$mail_to"))) { printMessage('Unable To Send E-Mail', "We're sorry but we were unable to send your e-mail. " . 'If you are sure that you entered all your email ' . 'addresses properly, you should contact your server ' . 'administrator.'); }
// Send a message to the form's owner. elseif(CC_FB_DO_EMAIL && !(mail($mail_to,$subject, $form_owner_msg, 'From: CoffeeCup Flash Form Builder ' . "<formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL . "$cc$bcc" . 'Message-ID: <' . time() . "-formbuilder@{$_SERVER['SERVER_NAME']}>" . CC_FB_SENDMAIL_EOL . 'X-Mailer: PHP v' . phpversion() . CC_FB_SENDMAIL_EOL . $form_owner_headers, "-f$mail_to"))) { printMessage('Unable To Send E-Mail', "We're sorry but we were unable to send your e-mail. " . 'If you are sure that you entered all your email ' . 'addresses properly, you should contact your server ' . 'administrator.');
Now essentially what I have done here is tracked down everywhere in that script that uses the mail function and added the 5th parameter which, according to the ISP, needs to consist of the -f switch followed by the email address of the sender. In this case it appears the sender is located in the $mail_to variable.
So in theory this should work for you if the email address in $mail_to is an actual working email address... which should be since you said you have sent mail before with this until they upgraded.
So give it a shot and see what happens. Make sure you have clearly identified these areas and made only the changes I have shown above. You might have to come back to these sections if this fix doesn't work.
If it doesn't work, be sure to report any error messages you receive. Thanks for helping me help you.
Hi Martyr2
Just to let you know, this script works on the site:
Yeh its fixed well done Martyr2 you are such a star. There must have been a conflict with using root as now when I use anything before the @ sign its working fine. Thank you so much I appriciate this more than you can ever imagine.