kinetic Posted September 21, 2007 Share Posted September 21, 2007 I was writing a contact us form based off the tell a friend forms in CCv4.0.01 and noticed that although it does submit it does not pass the senders IP and does not pass the senders name in the subject line or body you end up with a subject line like this Product Recommended by {SENDER_NAME} ok first things first lets fix the Senders IP Open language/en/email.inc.php FIND: Sender's IP Address: {SERDER_IP}", REPLACE with: Sender's IP Address: {SENDER_IP}", Save and Close: language/en/email.inc.php next OPEN: includes/content/tellafriend.inc.php FIND: if ($floodControlPass) { ## make email require("classes".CC_DS."htmlMimeMail".CC_DS."htmlMimeMail.php"); $lang = getLang("email.inc.php"); $mail = new htmlMimeMail(); $macroArray = array( 'RECIP_NAME' => sanitizeVar($_POST['recipName']), 'MESSAGE' => stripslashes(sanitizeVar(strip_tags($_POST['message']))), 'PRODUCT_URL' => $GLOBALS['storeURL'].'/index.php?_a=viewProd&productId='.sanitizeVar($_GET['productId']), 'STORE_URL' => $GLOBALS['storeURL'], 'SENDER_IP' => $_SERVER['REMOTE_ADDR'], ); $text = macroSub($lang['email']['tellafriend_body'], $macroArray); unset($macroArray); $macroArray = array( "{SENDER_NAME}" => sanitizeVar($_POST['senderName']) ); $mail->setText($text); $mail->setReturnPath($_POST['senderEmail']); $mail->setFrom($_POST['senderName'].' <'.$_POST['senderEmail'].'>'); $mail->setSubject(macroSub($lang['email']['tellafriend_subject'], $macroArray)); $mail->setHeader('X-Mailer', 'CubeCart Mailer'); $send = $mail->send(array($_POST['recipEmail']), $config['mailMethod']); } REPLACE WITH: if ($floodControlPass) { ## make email require("classes".CC_DS."htmlMimeMail".CC_DS."htmlMimeMail.php"); $lang = getLang("email.inc.php"); $mail = new htmlMimeMail(); $macroArray = array( 'RECIP_NAME' => sanitizeVar($_POST['recipName']), 'MESSAGE' => stripslashes(sanitizeVar(strip_tags($_POST['message']))), 'PRODUCT_URL' => $GLOBALS['storeURL'].'/index.php?_a=viewProd&productId='.sanitizeVar($_GET['productId']), 'STORE_URL' => $GLOBALS['storeURL'], 'SENDER_IP' => $_SERVER['REMOTE_ADDR'], 'SENDER_NAME' => sanitizeVar($_POST['senderName']) ); $text = macroSub($lang['email']['tellafriend_body'], $macroArray); $mail->setText($text); $mail->setReturnPath($_POST['senderEmail']); $mail->setFrom($_POST['senderName'].' <'.$_POST['senderEmail'].'>'); $mail->setSubject(macroSub($lang['email']['tellafriend_subject'], $macroArray)); $mail->setHeader('X-Mailer', 'CubeCart Mailer'); $send = $mail->send(array($_POST['recipEmail']), $config['mailMethod']); } Save and Close includes/content/tellafriend.inc.php Upload both files back to your server and tell afriend will be working a real treat hopefully this will make it into the next patch release. Kinetic :) Quote Link to comment Share on other sites More sharing options...
Guest thimk Posted September 23, 2007 Share Posted September 23, 2007 Have you submitted this as a bug report on Mantis? http://www.cubecart.com/beta/bugs/ Quote Link to comment Share on other sites More sharing options...
Guest marline Posted January 12, 2008 Share Posted January 12, 2008 I was writing a contact us form based off the tell a friend forms in CCv4.0.01 and noticed that although it does submit it does not pass the senders IP and does not pass the senders name in the subject line or body you end up with a subject line like this Product Recommended by {SENDER_NAME} ok first things first lets fix the Senders IP Open language/en/email.inc.php FIND: Sender's IP Address: {SERDER_IP}", REPLACE with: Sender's IP Address: {SENDER_IP}", Save and Close: language/en/email.inc.php next OPEN: includes/content/tellafriend.inc.php FIND: if ($floodControlPass) { ## make email require("classes".CC_DS."htmlMimeMail".CC_DS."htmlMimeMail.php"); $lang = getLang("email.inc.php"); $mail = new htmlMimeMail(); $macroArray = array( 'RECIP_NAME' => sanitizeVar($_POST['recipName']), 'MESSAGE' => stripslashes(sanitizeVar(strip_tags($_POST['message']))), 'PRODUCT_URL' => $GLOBALS['storeURL'].'/index.php?_a=viewProd&productId='.sanitizeVar($_GET['productId']), 'STORE_URL' => $GLOBALS['storeURL'], 'SENDER_IP' => $_SERVER['REMOTE_ADDR'], ); $text = macroSub($lang['email']['tellafriend_body'], $macroArray); unset($macroArray); $macroArray = array( "{SENDER_NAME}" => sanitizeVar($_POST['senderName']) ); $mail->setText($text); $mail->setReturnPath($_POST['senderEmail']); $mail->setFrom($_POST['senderName'].' <'.$_POST['senderEmail'].'>'); $mail->setSubject(macroSub($lang['email']['tellafriend_subject'], $macroArray)); $mail->setHeader('X-Mailer', 'CubeCart Mailer'); $send = $mail->send(array($_POST['recipEmail']), $config['mailMethod']); } REPLACE WITH: if ($floodControlPass) { ## make email require("classes".CC_DS."htmlMimeMail".CC_DS."htmlMimeMail.php"); $lang = getLang("email.inc.php"); $mail = new htmlMimeMail(); $macroArray = array( 'RECIP_NAME' => sanitizeVar($_POST['recipName']), 'MESSAGE' => stripslashes(sanitizeVar(strip_tags($_POST['message']))), 'PRODUCT_URL' => $GLOBALS['storeURL'].'/index.php?_a=viewProd&productId='.sanitizeVar($_GET['productId']), 'STORE_URL' => $GLOBALS['storeURL'], 'SENDER_IP' => $_SERVER['REMOTE_ADDR'], 'SENDER_NAME' => sanitizeVar($_POST['senderName']) ); $text = macroSub($lang['email']['tellafriend_body'], $macroArray); $mail->setText($text); $mail->setReturnPath($_POST['senderEmail']); $mail->setFrom($_POST['senderName'].' <'.$_POST['senderEmail'].'>'); $mail->setSubject(macroSub($lang['email']['tellafriend_subject'], $macroArray)); $mail->setHeader('X-Mailer', 'CubeCart Mailer'); $send = $mail->send(array($_POST['recipEmail']), $config['mailMethod']); } Save and Close includes/content/tellafriend.inc.php Upload both files back to your server and tell afriend will be working a real treat hopefully this will make it into the next patch release. Kinetic Do you know how to fix TAF in 3.0.15 or beyond? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.