roblaus Posted August 22, 2014 Share Posted August 22, 2014 (edited) Hi, I am almost done with my new shop (1.6.0.9), email is working (I am getting new orders and the customer gets all his confirmations etc.) but unfortunately mails from the contact form are not getting sent to the customer service address / webmaster (both are set to the same address). Interesting: The notification to the customer (mail has been sent) works in the case of customer service but not for webmaster. Weird.I am using my own smtp server on my own linux server, so no problems here. Any help is appreciated since I'd like to go live today. Edited August 24, 2014 by roblaus (see edit history) Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 22, 2014 Share Posted August 22, 2014 Hi, I am almost done with my new shop (1.6.0.9), email is working (I am getting new orders and the customer gets all his confirmations etc.) but unfortunately mails from the contact form are not getting sent to the customer service address / webmaster (both are set to the same address). Interesting: The notification to the customer (mail has been sent) works in the case of customer service but not for webmaster. Weird. I am using my own smtp server on my own linux server, so no problems here. Any help is appreciated since I'd like to go live today. Try and change the email to another email. Then change it back. I know, I know, a shot in the dark but without any error message or more details, it's hard to troubleshoot. Link to comment Share on other sites More sharing options...
bellini13 Posted August 22, 2014 Share Posted August 22, 2014 Mail Relay is likely the issue When a customer sends you a message from the contact us page, there are 2 emails that are sent 1) Email goes to the customer confirming their submission. 2) Email goes to the customer service address informing you that a new message has been received. When #2 is sent, Prestashop uses the customers email address as the FROM address. Most likely your SMTP server does not allow mail to be sent from domains other than your domain. You can do 1 of 2 things 1) You can edit/override the Mail class, so that mail is always sent FROM your email address 2) You can edit/override the ContactUsController so that instead of using the customers address as the FROM, it would use your email address 1 Link to comment Share on other sites More sharing options...
roblaus Posted August 23, 2014 Author Share Posted August 23, 2014 (edited) @bellini: Thanks, this sounds reasonable but I am not sure whether it is correct (unless the code was changed). I am running a 1.5.x shop for quite some time now and when I am looking at the messages I get then it's always FROM the shop's email and shows the customer's email address as "reply to". Which is the correct way in order to circumvent the SMTP restrictions. @Benjamin: Of course that's what I did first. I will have a look at the postfix error protocol, maybe the error shows there. [edit] Bellini - you are correct, this is what the log says (edited for pricacy reasons): NOQUEUE: reject: RCPT from myserver.server.com[213.133.xxx.xxx]: 553 5.7.1 <[email protected]>: Sender address rejected: not owned by user info@mydomain; from=<[email protected]> to=<robert@mydomain> proto=ESMTP helo=<[213.133.xxx.xxx]> Aug 23 09:47:10 myserver postfix/smtps/smtpd[3769]: disconnect from myserver.server.com[213.133.xxx.xxx]I will try your second solution, nonetheless I consider this a bug because almost all smtp servers will behave similarily. I'll report back... Edited August 23, 2014 by roblaus (see edit history) Link to comment Share on other sites More sharing options...
roblaus Posted August 23, 2014 Author Share Posted August 23, 2014 OK, I tried and failed. I compared the mail class and the ContactController of 5 and 6 and couldn't find anything changed related to the FROM address. Which doesn't mean a lot because I am not a developer. If anybody could give me a push into the right direction... Tx Link to comment Share on other sites More sharing options...
bellini13 Posted August 23, 2014 Share Posted August 23, 2014 first, let's do #1 so we can show that it will correct the problem. Edit the file /classes/Mail.php using FTP and search for the function Send, it will look like this... public static function Send($id_lang, $template, $subject, $template_vars, $to, You should see the first line of code in that function, should look like this... around line 59 if you are using PS v1.6.0.9 $configuration = Configuration::getMultiple(array( Add the following above that line so it would look like this $from = $configuration['PS_SHOP_EMAIL']; $configuration = Configuration::getMultiple(array( That will force the FROM address to always be your shop domain for every email that is sent 1 Link to comment Share on other sites More sharing options...
roblaus Posted August 23, 2014 Author Share Posted August 23, 2014 Yep, worked. Thanks a bunch... Link to comment Share on other sites More sharing options...
Annesjn Posted February 5, 2015 Share Posted February 5, 2015 (edited) Worked for me also. This is a pain along with the PHP issue. I use NameCheap hosting and they no longer allow sending email via PHP. Bellini, Thanks for all of your useful posts. I've been using your braintree module for a few weeks no and I'm really liking it. Edited February 5, 2015 by Annesjn (see edit history) Link to comment Share on other sites More sharing options...
CBLBTL Posted May 30, 2019 Share Posted May 30, 2019 Any solution for 1.7.5? Link to comment Share on other sites More sharing options...
thrillmetoo Posted June 14, 2019 Share Posted June 14, 2019 One more vote for this. What is the solution for 1.7.4? Link to comment Share on other sites More sharing options...
TVBZ Posted July 15, 2022 Share Posted July 15, 2022 Yes.. any solution for PS 1.7.7? Link to comment Share on other sites More sharing options...
Craig Day Posted August 12, 2022 Share Posted August 12, 2022 I had a similar problem and the hosting company advised to use these values: 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