Jump to content

Contact Form e-mails not send


Recommended Posts

Hi,

 

From a few days ago the messages sent by customers in the contact form or in the order messages area (after login) are not forward to the shop e-mail address but are recorded in the customer service area.

 

The settings (smtp server, email address etc) are all ok and the mails for the new orders or status updates of the orders are all ok.

 

Any ideias ?

 

Thanks in advance

Link to comment
Share on other sites

this is likely that the smtp server that you use, does not allow for email relay. when a customer sends you a message using the contact form, prestashop sends the email from the customers email address. most secure SMTP gateways would not allow for that.

 

if this is the issue you have, then you would have to change the ContactController code so that it sends from your email address, and not the customers

Link to comment
Share on other sites

Hi,

 

is a great idea even though the SMTP server should accept all the messages because it's authenticated and not only from the domain in question, but ok.

 

Now how can I set an e-mail for the from headers of that e-mails so that all e-mails would be processed as sent from eg webmaster "at" mydomain.com but obviously in the body of the email appears the user email .....

 

For the messages in the orders is the same file ?

 

Thanks in advance

Link to comment
Share on other sites

you have to edit the ContactController.php, and change the code that uses the customer email as the from email. if you would like me to do the coding for you, that is a service I can provide. you can PM me for additional details.

Link to comment
Share on other sites

  • 5 months later...
  • 3 months later...

Hi there:

 

When I use Customer Service to reply email.

After Click" Send my reply" .

 

It shows:Error - The following e-mail template is missing: /home/fancyc6/public_html/mails/en/reply_msg.html

 

how to fix that?

 

Thanks,

 

make sure that reply_msg.html and reply_msg.txt do exist there or if permissions are ok to access it.

Link to comment
Share on other sites

  • 1 year later...

The crude way of fixing relay issues is to edit ContactController.php. Find this string

if (empty($contact->email))
						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, null, null, $fileAttachment);
					else
					{					
						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.');
					}

and replace it with:

$configuration = Configuration::getMultiple(array('PS_SHOP_EMAIL'));//configuracion del mail
					$from_r = (isset($configuration['PS_SHOP_EMAIL']) && $configuration['PS_SHOP_EMAIL'])?($configuration['PS_SHOP_EMAIL'])$from);
					if (empty($contact->email))
						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, null, null, $fileAttachment);
					else
					{					
						if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]',
							$var_list, $contact->email, $contact->name, $from_r, ($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.');
					}
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 years later...
  • 3 weeks later...
On 4/15/2018 at 11:02 PM, Burak KAYMAKCI said:

It's been years but what about PrestaShop 1.7 ? It doesn't have anything similar to this in its ContactController.php

I am also having the same issue with 1.7. Can anyone help please. Thank you

Link to comment
Share on other sites

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...