aperio Posted August 19, 2010 Share Posted August 19, 2010 I cannot get the contact us form to send, but all other mail forms do.I have tried all the posted sample fixes i could find... i replaced contact-form.php with an older one that was posted in another thread, I have tried the edits in files from the presto-changeo site and no good.The send to a friend works just fine.The admin email test works fine.I am only trying to use the PHP mail() method.The contact us form simply does not work whether logged in or not. I get an error that simply says this and nothing more: There is 1 error : 1. an error occurred while sending message I could understand it being a server configuration error if no mail sending worked consistently throughout, but it is only the contact form. Does anyone have any insight into this? I am running version 1.3.1.1. Link to comment Share on other sites More sharing options...
aperio Posted August 19, 2010 Author Share Posted August 19, 2010 As another side note and testament to the fact that this appears to be a PrestaShop bug, I have installed a separate contact form into the site and it works just fine.. But I would prefer to use the built-in prestashop form so that it can utilize the contact options administered from the shop admin.Does anyone have any idea on what the problem is with the contact form script that is causing it to not work properly? Link to comment Share on other sites More sharing options...
Mister Denial Posted August 30, 2010 Share Posted August 30, 2010 I have exactly the same error, using 1.3.1.1 and being hosted on Bluehost. Any help regarding this matter would be much appreciated here too. Link to comment Share on other sites More sharing options...
aperio Posted August 30, 2010 Author Share Posted August 30, 2010 Ha... my problem was on bluehost also. The solution? Create a mail account for the domain and use that email as the sending email address(even though yes, i know.. it should only be an issue with smtp sendings.. but it is effecting the php mail sends as well).Try that and it should solve your problem. Link to comment Share on other sites More sharing options...
Mister Denial Posted August 31, 2010 Share Posted August 31, 2010 Hi aperio,thank you for your reply, I guess the problem might be with Bluehost then. Could you go a bit more into detail, I am not sure to have understood what you did to make it work. Did you switch from PHP mail to sending them through SMTP? There are quite some possible options with Bluehost, like SSL, TSL or none encryption, so a few pointers would be great to get me on the right tracks.Thanks a lot in advance! Link to comment Share on other sites More sharing options...
Mister Denial Posted August 31, 2010 Share Posted August 31, 2010 UPDATE: I found out that when customers are logged in, it works perfectly fine, but when logged out, it always results in a 01. error when trying to use the form. Link to comment Share on other sites More sharing options...
aperio Posted August 31, 2010 Author Share Posted August 31, 2010 Okay I have tried to backtrack to be able to relay to you exactly what I did (because i literally tried every combination of things to get this to work) Here's what I've come up with:First thing you want to do is to setup a mail account through your cpanel (or equivalent) for your domain... so for the example, let's say you set up an email account of [email protected]. Next, go into your prestashop adminarea in the "Preferences" tab, select "Contact" and change the shop email to the email you just set up in the previous step. I also changed the emails in the "Employees -> Contacts" but i was desperate to try anything and not sure that was necessary).Then you'll need to edit a couple files:In /tools/swift/Swift/Message.php Around line 79 Change this: $this->setFrom(""); To This: $this->setFrom("[email protected]"); In /tools/swift/Swift.php After line 370 which is this line: if (!($has_reply_to = $message->getReplyTo())) $message->setReplyTo($from); Add this: if (!$has_reply_to[0]) $message->setReplyTo($from->getAddress()); Try it now and see if it works. If it doesn't then also try this last edit:In /tools/swift/Swift/Plugin/MailSend.php After line 159 add: $params = ""; That's everything I can think of that I did (other than pulling my hair out and throwing a few tantrums) that eventually led to it working. I hope this helps to resolve your problem. If you need any further help I'm always happy to pitch in and try.. you can find me at http://www.grooviness.com any time (except Sundays). Link to comment Share on other sites More sharing options...
d.bo Posted September 1, 2010 Share Posted September 1, 2010 i try to do,but this trouble still exists. Link to comment Share on other sites More sharing options...
Mister Denial Posted September 1, 2010 Share Posted September 1, 2010 Thanks aperio! I will definitely give this a try and let you know if it worked. Thanks a lot for your help.I still think it is strange that when logged in, the form works fine, but when logged out, not. I've posted on the french support forum about this too, maybe that will shed some light on this matter. If it does, I will let you know too!Have a great day! Link to comment Share on other sites More sharing options...
hopis Posted September 8, 2010 Share Posted September 8, 2010 Being logged in or not makes no difference on my site Sounds like the mail server must be on the same server as the one your site is hosted on.Will try the aperio solution.Rgds Link to comment Share on other sites More sharing options...
Mister Denial Posted September 9, 2010 Share Posted September 9, 2010 Aperios solution did definitely work, emails work well again through the contact form. I only had to do the first two steps to make it work, I did NOT have to edit the MailSend.php file. Works like a charm!So a big thank you to aperio for hist assistance, it's much appreciated! Link to comment Share on other sites More sharing options...
aperio Posted September 9, 2010 Author Share Posted September 9, 2010 That is great news! I am so happy that you were able to get it working Link to comment Share on other sites More sharing options...
texscalper Posted October 7, 2010 Share Posted October 7, 2010 Hi, I have Bluehost too.I got the same problem and with Bluehost support I resolved the problem some time ago.Yesterday, after upgrading to version 1.3.2, I got the problem again in the contact-form.php .I just added :$fromName = 'Contact';just before : if (!($from = Tools::getValue('from')) OR !Validate::isEmail($from)) $errors[] = Tools::displayError('invalid e-mail address');and changed the last $from into $fromNamein the line :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 : $fromName)))Now it seems to work.Claudio Link to comment Share on other sites More sharing options...
marco989 Posted October 30, 2010 Share Posted October 30, 2010 Hi texscalper,i have teh same problem in v 1.3.2. where excatly (in which file) did you make teh above changes?Hi, I have Bluehost too.I got the same problem and with Bluehost support I resolved the problem some time ago.Yesterday, after upgrading to version 1.3.2, I got the problem again in the contact-form.php .I just added :$fromName = ‘Contact’;just before :if (!($from = Tools::getValue(‘from’)) OR !Validate::isEmail($from)) $errors[] = Tools::displayError(‘invalid e-mail address’);and changed the last $from into $fromNamein the line :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 : $fromName))) Now it seems to work.Claudio Link to comment Share on other sites More sharing options...
texscalper Posted November 1, 2010 Share Posted November 1, 2010 In the contact-form.php as written in the post. Yesterday, after upgrading to version 1.3.2, I got the problem again in the contact-form.php ... Link to comment Share on other sites More sharing options...
marco989 Posted November 1, 2010 Share Posted November 1, 2010 thanks,i tried, doesn't work for me. it seems that teh form tries to get the customer id/customer name.without this variable it just won't send.it has to do with this condition (since the error given is 'an error occurred while sending message'):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');no clue what and how. by others it just works.a simple work-around would be to simply link teh contact-us.php page to my own page, a different one, and operate teh contact from there. Link to comment Share on other sites More sharing options...
ddoan2007 Posted January 15, 2011 Share Posted January 15, 2011 Hi,I am on bluehost too and this is what I found. I just installed version 1.3.6 and I get the same problem, ie contact form gives error while the admin test send email works. So I installed version 1.3.5 (in another sub directory) and the problem goes away. Therefore, it looks to me it is a definite bug in prestashop. This bug first appeared in some versions ago and seemed to be fixed up till apparently version 1.3.5 and now it appears again in 1.3.6 Link to comment Share on other sites More sharing options...
ddoan2007 Posted January 15, 2011 Share Posted January 15, 2011 Correction. version 1.3.5 didn't work either. I was looking at a different version of version 1.3.5 Damn! Link to comment Share on other sites More sharing options...
Mister Denial Posted January 15, 2011 Share Posted January 15, 2011 @ ddoan2007: have you tried the modifications to the code that aperio suggested previously in this thread? I used that method, and worked like a charm. I have not tested with 1.3.5 yet though, so I can't say for sure if it still solves the problem, but it did on 1.3.2Hope it will work for you, and good luck! Link to comment Share on other sites More sharing options...
ddoan2007 Posted January 15, 2011 Share Posted January 15, 2011 @ ddoan2007: have you tried the modifications to the code that aperio suggested previously in this thread? I used that method, and worked like a charm. I have not tested with 1.3.5 yet though, so I can't say for sure if it still solves the problem, but it did on 1.3.2Hope it will work for you, and good luck! Hi, I am sure that it will work, as suggested by aperio. I've done it with 1.3.1 The thing is I want to know who to blame, is it prestashop or Bluehost. This is driving me nuts. If it's bluehost then it's probably a good idea to go looking for another host. Cheers. Link to comment Share on other sites More sharing options...
marco989 Posted January 16, 2011 Share Posted January 16, 2011 true, same problem here, after reinstalling in a nea map, new database, it works.very weird, i do belive it's some ps issue. but ya... we all learn!so for all others with this contact form problem , jus reinstall in another map and use a new database. Link to comment Share on other sites More sharing options...
Mister Denial Posted January 17, 2011 Share Posted January 17, 2011 I think it is a PS problem more than a hosting problem, considering some minor tweaking to the code solves the problem. But then again, I am no expert, so it's more a gut feeling.And about changing your host, I must say that I am very happy with Bluehost - over the past ten years I have tried several other companies, including Lycos and Yahoo, and none was nearly as good and reliable. Barely any server downs, many features, good price - I'd recommend Bluehost any day. Link to comment Share on other sites More sharing options...
ddoan2007 Posted January 17, 2011 Share Posted January 17, 2011 I think it is a PS problem more than a hosting problem, considering some minor tweaking to the code solves the problem. But then again, I am no expert, so it's more a gut feeling.And about changing your host, I must say that I am very happy with Bluehost - over the past ten years I have tried several other companies, including Lycos and Yahoo, and none was nearly as good and reliable. Barely any server downs, many features, good price - I'd recommend Bluehost any day. Don't get me wrong. I very much love Bluehost. I think they are fantastic. It's just this hiccup that is quite annoying. I upload prestashop on another web host Glovine who offers a free web host plan which I used mainly for testing, and everything works out of the box! So definitely, it's something to do with bluehost, maybe it's the way they set up their mail server. It's lucky for us that this problem can be fixed easily otherwise I will have to go elsewhere for web hosting because I cannot have the situation where a potential customer cannot contact us. I am working with Fabien who I think is on the prestashop team, to try and work out what is wrong with bluehost. So hopefully, we won't have to have this hack again. Link to comment Share on other sites More sharing options...
Mister Denial Posted January 17, 2011 Share Posted January 17, 2011 Oh, that would be good, if it was fixed to work out of the box with most common hosts - and Bluehost is definitely one of the most popular out there. Link to comment Share on other sites More sharing options...
msk69 Posted January 18, 2011 Share Posted January 18, 2011 have a look here: http://www.presto-changeo.com/content/9-fix-email-problemsi did a site on bluehost once, and believe that solved it. Link to comment Share on other sites More sharing options...
ddoan2007 Posted January 18, 2011 Share Posted January 18, 2011 Yes, the "hack" from presto does the job but we are trying to get to root cause of this issue and finally I think Fabien has managed to find out what was wrong and so hopefully we can expect to have everything works "out of the box" with the next release. Link to comment Share on other sites More sharing options...
msk69 Posted January 19, 2011 Share Posted January 19, 2011 Check the SVN, of PS 1.3, it has been solved by the PS team.line 28 is to be replaced with: 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 : ''))) Link to comment Share on other sites More sharing options...
DsToys Posted February 18, 2011 Share Posted February 18, 2011 Thank you msk69, your solution works perfectly on ver. 1.3.3. Link to comment Share on other sites More sharing options...
Soy.es Posted February 19, 2011 Share Posted February 19, 2011 Check this: http://www.prestashop.com/bug_tracker/view/7799/I have problems with ssl send mails if you dont use ssl work fine.i reported the bug. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now