Jump to content

[Solved] Email to customer service not sent


Recommended Posts

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 by roblaus (see edit history)
Link to comment
Share on other sites

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

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

  • Like 1
Link to comment
Share on other sites

@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 by roblaus (see edit history)
Link to comment
Share on other sites

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

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

 

 

  • Like 1
Link to comment
Share on other sites

  • 5 months later...

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 by Annesjn (see edit history)
Link to comment
Share on other sites

  • 4 years later...
  • 3 weeks later...
  • 3 years later...
  • 4 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...