m8r-lhgra4 Posted August 17, 2014 Share Posted August 17, 2014 (edited) version 1.6.0.9 I do receive contact form notification to admin email some of the time, but other times I don't. After looking into my mail log, it appears if the customer uses gmail, the mail would be rejected. NOQUEUE: reject: RCPT from abc.com[00.000.000.000]: 000 0.0.0 <[email protected]>: Sender address rejected: Please use Gmail's SMTP servers; from=<customer@gmail.com> to=<[email protected]> proto=ESMTP helo=<localhost> Do i solve this by setting up gmail smtp in customer service options? If gmail smtp is setup, would it affect other mailing service domain, which do currently work? Edited August 17, 2014 by m8r-lhgra4 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 17, 2014 Share Posted August 17, 2014 what kind of mail method you use? simple mail() function ? you use in your shop email address hosted in gmail ? Link to comment Share on other sites More sharing options...
labeleng Posted September 1, 2014 Share Posted September 1, 2014 Hello Vekia, I have a similar problem. the Admin email do not receive notification email when contact form is used and when an order is placed. But i get other emails sent to the admin Link to comment Share on other sites More sharing options...
vekia Posted September 1, 2014 Share Posted September 1, 2014 Hello Vekia, I have a similar problem. the Admin email do not receive notification email when contact form is used and when an order is placed. But i get other emails sent to the admin hello are you able to verify server outgoing mails log? also, you have email alerts module installed? Link to comment Share on other sites More sharing options...
bellini13 Posted September 1, 2014 Share Posted September 1, 2014 version 1.6.0.9 I do receive contact form notification to admin email some of the time, but other times I don't. After looking into my mail log, it appears if the customer uses gmail, the mail would be rejected. NOQUEUE: reject: RCPT from abc.com[00.000.000.000]: 000 0.0.0 <[email protected]>: Sender address rejected: Please use Gmail's SMTP servers; from=<customer@gmail.com> to=<[email protected]> proto=ESMTP helo=<localhost> Do i solve this by setting up gmail smtp in customer service options? If gmail smtp is setup, would it affect other mailing service domain, which do currently work? This is called mail relay, and your SMTP server does not allow it. What Prestashop does is send the email FROM the customers address ([email protected]) to your contact address ([email protected]) You either need to ... 1) configure your SMTP server to allow mail relay (sending an email FROM an address that is not your server name/hostname). This is probably not even an option, but depends on who manages your SMTP server 2) Change the ContactController so that mail is always sent FROM your SMTP server username. Link to comment Share on other sites More sharing options...
ecommdev Posted December 27, 2014 Share Posted December 27, 2014 (edited) This is called mail relay, and your SMTP server does not allow it. What Prestashop does is send the email FROM the customers address ([email protected]) to your contact address ([email protected]) You either need to ... 1) configure your SMTP server to allow mail relay (sending an email FROM an address that is not your server name/hostname). This is probably not even an option, but depends on who manages your SMTP server 2) Change the ContactController so that mail is always sent FROM your SMTP server username. bellini13, Having the exact problem you mentioned, using your Swiftmailer module to use with Amazon SES for the SMTP aspect. It appears all emails are working except the contact form emails. Amazon requires email sent to be verified prior to sending so I can understand why the FROM isn't sending in the contact form because they are not verified. Do you have any module or easy fix for this problem and I am going to add a varialble to the mix, Prestashop 1.6.0.9 with Multistore enabled. Setting only one email for ALL the stores might be issue Unless there is a work around. Also, is there another contact form to entirely replace the current contact form to add the From and still display the messages in the BO? Let me know. Edited December 27, 2014 by ecommdev (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted December 28, 2014 Share Posted December 28, 2014 Hi there There are 2 options typically to solve this problem 1) Edit the Mail class so that it uses the shops email address when sending any email. This assumes that your shop email is 'verified' to send email 2) Edit just the ContactController class so that instead of sending the mail from the customers email address, it would use the shops email address. Option 2 is probably the better option for you, since the contact form is the only thing not working. Either option should be multi-store friendly, since each store should be able to have a separate email address I'm not aware of any contact form replacement modules. Link to comment Share on other sites More sharing options...
ecommdev Posted December 29, 2014 Share Posted December 29, 2014 Hi there There are 2 options typically to solve this problem 1) Edit the Mail class so that it uses the shops email address when sending any email. This assumes that your shop email is 'verified' to send email 2) Edit just the ContactController class so that instead of sending the mail from the customers email address, it would use the shops email address. Option 2 is probably the better option for you, since the contact form is the only thing not working. Either option should be multi-store friendly, since each store should be able to have a separate email address I'm not aware of any contact form replacement modules. bellini13, I totally agree option 2 would be the preferred method to fix the email issue. Do you or anyone else have instructions to edit the ContactController class method as mentioned in option 2? Once I have the instructions then I can edit but unclear at the moment what needs to edited within the file. Thank you for your guidance, advice, insight, I imagine this is helping many users within the community. Let me know. Link to comment Share on other sites More sharing options...
bellini13 Posted December 29, 2014 Share Posted December 29, 2014 (edited) You would edit the ContactController in /controllers/front/ Locate the following code if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]', $var_list, $contact->email, $contact->name, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''), $fileAttachment) || !Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $var_list, $from, null, $contact->email, $contact->name, $fileAttachment)) $this->errors[] = Tools::displayError('An error occurred while sending the message.'); In that first if statement, you will see the variable $from which is the customers email address. Change $from to null, which will force Prestashop to use the default store email address if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]', $var_list, $contact->email, $contact->name, null, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''), $fileAttachment) Edited December 29, 2014 by bellini13 (see edit history) 5 Link to comment Share on other sites More sharing options...
ecommdev Posted December 30, 2014 Share Posted December 30, 2014 A big shout out Thank you to Bellini Services for their help/guidance/instructions. Thank you!! Link to comment Share on other sites More sharing options...
Okidoki Posted January 29, 2015 Share Posted January 29, 2015 I´m not receiving contact form messages on my email. Did the your change, but not helped. :/ Link to comment Share on other sites More sharing options...
Recommended Posts