jordiob Posted June 8, 2011 Share Posted June 8, 2011 Never modified the code on contact-form.php but I always get the same error (no matter if user is logged in or not).I can't send e-mails through the contact-form because "email is not valid".Could anybody help me?This is the url: http://playandtour . net/contact-form.phpThanks a lot Link to comment Share on other sites More sharing options...
shokinro Posted June 9, 2011 Share Posted June 9, 2011 I followed the URL you provided, I didn't find any contact form available at your site.there is only a phone number and emails there.did you changed it? Link to comment Share on other sites More sharing options...
espresso Posted June 9, 2011 Share Posted June 9, 2011 bump...need help please Link to comment Share on other sites More sharing options...
jordiob Posted June 9, 2011 Author Share Posted June 9, 2011 Yes I did because I wasn't receiving any message Here's the contact-form.php code <?php $useSSL = true; include(dirname(__FILE__).'/config/config.inc.php'); include(dirname(__FILE__).'/header.php'); $errors = array(); $smarty->assign('contacts', Contact::getContacts(intval($cookie->id_lang))); if (Tools::isSubmit('submitMessage')) { $message = Tools::htmlentitiesUTF8(Tools::getValue('message')); if (!($from = Tools::getValue('from')) OR !Validate::isEmail($from)) $errors[] = Tools::displayError('invalid e-mail address'); elseif (!($message = nl2br2($message))) $errors[] = Tools::displayError('message cannot be blank'); elseif (!Validate::isMessage($message)) $errors[] = Tools::displayError('invalid message'); elseif (!($id_contact = intval(Tools::getValue('id_contact'))) OR !(Validate::isLoadedObject($contact = new Contact(intval($id_contact), intval($cookie->id_lang))))) $errors[] = Tools::displayError('please select a contact in the list'); else { if (intval($cookie->id_customer)) $customer = new Customer(intval($cookie->id_customer)); if (Mail::Send(intval($cookie->id_lang), 'contact', 'Message from contact form', array('{email}' => $from, '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, (intval($cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $from))) $smarty->assign('confirmation', 1); else $errors[] = Tools::displayError('an error occurred while sending message'); } } $email = Tools::safeOutput(Tools::getValue('from', ((isset($cookie) AND isset($cookie->email) AND Validate::isEmail($cookie->email)) ? $cookie->email : ''))); $smarty->assign(array( 'errors' => $errors, 'email' => $email )); $smarty->display(_PS_THEME_DIR_.'contact-form.tpl'); include(dirname(__FILE__).'/footer.php'); ?> Link to comment Share on other sites More sharing options...
shokinro Posted June 9, 2011 Share Posted June 9, 2011 from the code, I can tell nothing.If was trying to reproduce the error to see what exactly message will it displayed.Does it work for other emails?please check you have input a valid mail address at your storePreferences tab - Contact Information sub tab Link to comment Share on other sites More sharing options...
jordiob Posted June 9, 2011 Author Share Posted June 9, 2011 it's not working with any email the error is "not valid e-mail" I uploaded the old version now, just let me know if you find something please Thx! Link to comment Share on other sites More sharing options...
shokinro Posted June 9, 2011 Share Posted June 9, 2011 I just checked the page again, nothing changed. Link to comment Share on other sites More sharing options...
jordiob Posted June 9, 2011 Author Share Posted June 9, 2011 Compiled, try again please Link to comment Share on other sites More sharing options...
shokinro Posted June 9, 2011 Share Posted June 9, 2011 it seems that you are using a customized contact form.Can you try to replace following line if (!($from = Tools::getValue('from')) OR !Validate::isEmail($from)) with following line if (!($from = Tools::getValue('from')) OR !Validate::isEmail(Tools::getValue('from'))) if this does not work, just removed this two lines if (!($from = Tools::getValue('from')) OR !Validate::isEmail($from)) $errors[] = Tools::displayError('invalid e-mail address'); else or you maybe have to contact the original coder to get it fixed. Link to comment Share on other sites More sharing options...
jordiob Posted June 9, 2011 Author Share Posted June 9, 2011 Boss!!!!!!!!!!!!!!!Second solution worked. Thanks a lot!!!!!!!!!!!! Link to comment Share on other sites More sharing options...
shokinro Posted June 9, 2011 Share Posted June 9, 2011 please remember that the email address validation is removed.but it is not a big deal because no matter the customer input address correct, you can always receive an message. Link to comment Share on other sites More sharing options...
jordiob Posted June 9, 2011 Author Share Posted June 9, 2011 Thanks! I prefer to receive the e-mails anyway Link to comment Share on other sites More sharing options...
espresso Posted June 9, 2011 Share Posted June 9, 2011 wew .. my site still blank after sent contact email...I have to try all code above, but still blank page see below:http://ekashop.net/contact-form.php Link to comment Share on other sites More sharing options...
shokinro Posted June 9, 2011 Share Posted June 9, 2011 I am sure there are some errors are happening when submit the contact form.try to set "display_errors" to "on" in file /config/config.inc.php to see what happened Link to comment Share on other sites More sharing options...
espresso Posted June 10, 2011 Share Posted June 10, 2011 I am sure there are some errors are happening when submit the contact form.try to set "display_errors" to "on" in file /config/config.inc.php to see what happened Great!!I have found some error on tabfbcomment after activated "ON" , and now ..work fine thankstrouble found on tabfbcomment, but it has been fix Link to comment Share on other sites More sharing options...
Recommended Posts