exosian Posted April 8, 2020 Share Posted April 8, 2020 Hello, Currently, i'm out of options and really don't know how to resolve this matter. I don't even know if this is the right forum to seek guidance and resolve my problem. The thing is, prestashop won't send emails (through contactform). Test mail works (backend). But whenever a customer uses the internal contactform, it says: An error occurred while sending your message. I checked the logs, no logs regarding mail. No errors found. The website prompts only this error: An error occurred while sending your message. What error? What goes wrong? Why does the STANDARD contactform simply NOT WORK? For several weeks now I tried every thing on the internets to find a solution but nothing works. I tried every thing in my power and knowledge but this is it. Prestashop is really a great platform to start a webshop and want to use for all my customers but ONLY this one is bothering me hard time. I just can't make it work?! Do any one can help me out please? Link: www.exosian.com/contact Link to comment Share on other sites More sharing options...
Prescol Posted April 9, 2020 Share Posted April 9, 2020 Which version are you using? Prestashop has a parameter to enable debug mode. In PS1.6 is within a file called defines.inc.php, inside the config folder. In PS17 it´s in the backend. Link to comment Share on other sites More sharing options...
exosian Posted April 10, 2020 Author Share Posted April 10, 2020 3 hours ago, Prescol said: Which version are you using? Prestashop has a parameter to enable debug mode. In PS1.6 is within a file called defines.inc.php, inside the config folder. In PS17 it´s in the backend. Hi Prescol, Thank you for your comment. I am using PS17. After setting the debug modes ON i found this error (pop up) after I chose "Customer Service" from the backend. Warning on line 1046 in file /home/exosian/domains/exosian.com/public_html/controllers/admin/AdminCustomerThreadsController.php [2] count(): Parameter must be an array or an object that implements Countable START LINE 1046: if (count($errors) && is_array($errors)) { $str_errors = ''; foreach ($errors as $error) { $str_errors .= $error . ', '; } $str_errors = rtrim(trim($str_errors), ','); } After that, i have send some mails through the contact form. I uploaded the debug logs. debug.txt Link to comment Share on other sites More sharing options...
Knowband Plugins Posted April 10, 2020 Share Posted April 10, 2020 Try changing this line. if (count($errors) && is_array($errors)) { to if (is_array($errors) && count($errors)) { I believe it will fix the error but not sure if it will fix the email sending error OR not. 1 Link to comment Share on other sites More sharing options...
Prescol Posted April 10, 2020 Share Posted April 10, 2020 It is an incompatibility with PHP7.2. The solution proposed by Knoband should work. Link to comment Share on other sites More sharing options...
exosian Posted April 10, 2020 Author Share Posted April 10, 2020 (edited) After changing this: if (count($errors) && is_array($errors)) { to if (is_array($errors) && count($errors)) { Not changed anything. I still get this error "Fout opgetreden tijdens het verzenden van uw bericht." Which means: An error occurred while sending your message. Edited April 10, 2020 by exosian (see edit history) Link to comment Share on other sites More sharing options...
Prescol Posted April 10, 2020 Share Posted April 10, 2020 Nothing more? With debug enabled? Link to comment Share on other sites More sharing options...
exosian Posted April 10, 2020 Author Share Posted April 10, 2020 5 minutes ago, Prescol said: Nothing more? With debug enabled? No, nothing I can't see strange issues or such. It's just with debugging ON, the error message seems to disappear but still no emails received. It's just, only the mail doesn't work. All is default. I used PHP settings, my own configuration, nothing works. I always get that there is an error occured while sending the message... Link to comment Share on other sites More sharing options...
exosian Posted April 10, 2020 Author Share Posted April 10, 2020 3 minutes ago, exosian said: No, nothing I can't see strange issues or such. It's just with debugging ON, the error message seems to disappear but still no emails received. It's just, only the mail doesn't work. All is default. I used PHP settings, my own configuration, nothing works. I always get that there is an error occured while sending the message... Also, I own another store (brand new) on prestashop 1.7, same issue. Very same issue. E-mails can't be send through contact form due an error. Link to comment Share on other sites More sharing options...
Prescol Posted April 10, 2020 Share Posted April 10, 2020 Did you set the right email address in preferences->contact? Link to comment Share on other sites More sharing options...
exosian Posted April 10, 2020 Author Share Posted April 10, 2020 1 minute ago, Prescol said: Did you set the right email address in preferences->contact? Yes, it's the right one. Link to comment Share on other sites More sharing options...
Prescol Posted April 10, 2020 Share Posted April 10, 2020 Have you checked Prestashop log? it looks like swiftmailer errors are logged there Link to comment Share on other sites More sharing options...
exosian Posted April 10, 2020 Author Share Posted April 10, 2020 Just now, Prescol said: Have you checked Prestashop log? it looks like swiftmailer errors are logged there The dev or prod log? I see two files in var/logs Link to comment Share on other sites More sharing options...
Prescol Posted April 10, 2020 Share Posted April 10, 2020 En el backoffice. Parámetros avanzados-> registros/logs Link to comment Share on other sites More sharing options...
exosian Posted April 10, 2020 Author Share Posted April 10, 2020 I can only see lots of "CustomerThread removal". Can't click on them. Link to comment Share on other sites More sharing options...
Prescol Posted April 10, 2020 Share Posted April 10, 2020 With level 3? Link to comment Share on other sites More sharing options...
exosian Posted April 10, 2020 Author Share Posted April 10, 2020 Not sure what level is so I have attached a screenshot. On "Foutcode" (error code) everything is on "0". Link to comment Share on other sites More sharing options...
Prescol Posted April 10, 2020 Share Posted April 10, 2020 Just a little bit of the table there is a legend. The level we are looking for is the red one. Link to comment Share on other sites More sharing options...
exosian Posted April 10, 2020 Author Share Posted April 10, 2020 21 minutes ago, Prescol said: Just a little bit of the table there is a legend. The level we are looking for is the red one. I've found only 5 errors. Nothing related to mail. Link to comment Share on other sites More sharing options...
Prescol Posted April 10, 2020 Share Posted April 10, 2020 There is one thread in this forum about a similar problem and the talk about updating contact module. Link to comment Share on other sites More sharing options...
maconl Posted April 11, 2020 Share Posted April 11, 2020 Long time ago i had the same , only other prestashop version it was at client side server related , so not prestashop ! to solve temporary i used the php mail function so he could use the shop , the forms wil work ! and i had the time to find out where the problems came from , perhaps this is for short a tempory solution to use php mail function , and or it is like already said a php 7.2 issue , but i don't have any problems in my own shop ,, with php 7,2 you can try to switch to at php 7.0 or php 7.1 what are the settings u are using ? are they right ? do u use imap or pop ? for now you can use PHP Mailfunction so you can go on with your shop Link to comment Share on other sites More sharing options...
Prescol Posted April 11, 2020 Share Posted April 11, 2020 Php mail function is used if no mail configuration provided. Link to comment Share on other sites More sharing options...
exosian Posted April 11, 2020 Author Share Posted April 11, 2020 8 hours ago, maconl said: Long time ago i had the same , only other prestashop version it was at client side server related , so not prestashop ! to solve temporary i used the php mail function so he could use the shop , the forms wil work ! and i had the time to find out where the problems came from , perhaps this is for short a tempory solution to use php mail function , and or it is like already said a php 7.2 issue , but i don't have any problems in my own shop ,, with php 7,2 you can try to switch to at php 7.0 or php 7.1 what are the settings u are using ? are they right ? do u use imap or pop ? for now you can use PHP Mailfunction so you can go on with your shop Hi! Thank you so much for your comment.Here are my settings: PHP: 7.3.15 Webserver: LiteSpeed V7.6 Prestashop 1.7 I already used the PHP function but i'm going to give it another try. If this is not working, i'm going to delete/disable the prestashop's contactform and purchase Contact Form 7 (which always works). Link to comment Share on other sites More sharing options...
exosian Posted April 11, 2020 Author Share Posted April 11, 2020 Just now, exosian said: Hi! Thank you so much for your comment.Here are my settings: PHP: 7.3.15 Webserver: LiteSpeed V7.6 Prestashop 1.7 I already used the PHP function but i'm going to give it another try. If this is not working, i'm going to delete/disable the prestashop's contactform and purchase Contact Form 7 (which always works). + all settings are correct. I am receiving the test e-mail from the back-end. Link to comment Share on other sites More sharing options...
exosian Posted April 11, 2020 Author Share Posted April 11, 2020 I changed it to php and send a test mail, received. Went back to contactform, same error..... Link to comment Share on other sites More sharing options...
Prescol Posted April 11, 2020 Share Posted April 11, 2020 There is a tab called information where you can see if some files has been modified. You should check that. Link to comment Share on other sites More sharing options...
Guest Posted April 12, 2020 Share Posted April 12, 2020 (edited) And is there an email template for the language selected in the BO? ./themes/nixx/mails/** shop lang/(contact.html and contact.html for registered user) and (contact_form.txt and contact_form.html for host) ** shop lang is an abbreviation of language, eg. nl, en .... Edited April 12, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
finchy01 Posted April 13, 2020 Share Posted April 13, 2020 (edited) Hi, Just wondering if there is a resolution on this? I am having the same issue in 1.7.6.4. Out of the box install, no emails are being sent. Test emails work, just not after a user submits a query via the contact form. Have tried with php versions 5.6 through to 7.3 and no luck. Thank you Edited April 13, 2020 by finchy01 (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted April 13, 2020 Share Posted April 13, 2020 Is SMTP set up and not working? Is sending via PHP mail ? Do you have php mail enabled on your web host? Do you have any module eg google recaptcha installed? Link to comment Share on other sites More sharing options...
finchy01 Posted April 13, 2020 Share Posted April 13, 2020 I set up SMTP and that has the same issue - it sends a test email fine but no email from the contact form. Test email only from PHP mail, not from contact form. Yes. No, clean install out of the box has this issue. Link to comment Share on other sites More sharing options...
Guest Posted April 13, 2020 Share Posted April 13, 2020 You should receive two emails. Link to comment Share on other sites More sharing options...
finchy01 Posted April 14, 2020 Share Posted April 14, 2020 I did not receive any mail with that script. Link to comment Share on other sites More sharing options...
Guest Posted April 14, 2020 Share Posted April 14, 2020 (edited) Mail::Send is Prestashop function mail(... Is PHP mail function If php function doesn't work, php mail function is not enabled on your web host. Check that your Prestashop email is correct. You can insert an echo into the script before include (... Quote echo Configuration::get('PS_SHOP_EMAIL'); Edited April 14, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
Guest Posted April 14, 2020 Share Posted April 14, 2020 Check if PHP mail function exists: Quote <?php if ( function_exists( 'mail' ) ) { echo 'mail() is available'; } else { echo 'mail() has been disabled'; } Link to comment Share on other sites More sharing options...
Guest Posted April 14, 2020 Share Posted April 14, 2020 (edited) Help for all who do not know if everything is properly set and enabled PHP mail () function on their webhost. 1. Save the attached test-mail.php file to the Prestashop main directory. Only registered and logged users can download the attachment. test-mail.php 2. Paste the address of the eshop and the file path into your browser. e.g: https://mydomain.com/test-mail.php 3. When everything is OK, you get the information as in the picture: 4. If there is an error somewhere, you will get an error message. You'll post this message here, but first read the thread to see if your problem is already resolved by chance. Edited April 14, 2020 by Guest (see edit history) Link to comment Share on other sites More sharing options...
finchy01 Posted April 14, 2020 Share Posted April 14, 2020 Thank you for this script. I get the following line printed. php function mail() is available and that is all - no errors are printed and there are no errors going to the console Link to comment Share on other sites More sharing options...
finchy01 Posted April 14, 2020 Share Posted April 14, 2020 When I try to get the configuration by adding this to the script (after the include of config.inc.php) echo Configuration::get('PS_SHOP_EMAIL'); if ( function_exists( 'mail' ) ) { echo 'mail() is available'; } else { echo 'mail() has been disabled'; } I don't get anything printed to screen either or anything in the console. Link to comment Share on other sites More sharing options...
finchy01 Posted April 14, 2020 Share Posted April 14, 2020 If I remove all from the php file except for the following: include('./config/config.inc.php'); echo Configuration::get('PS_SHOP_EMAIL'); if ( function_exists( 'mail' ) ) { echo 'mail() is available'; } else { echo 'mail() has been disabled'; } I get the email address configured for the shop correctly displaying and the line mail() is available Link to comment Share on other sites More sharing options...
finchy01 Posted April 14, 2020 Share Posted April 14, 2020 (edited) It seems as though the Mail::Send function is not working but the php mail function is ok Edited April 14, 2020 by finchy01 (see edit history) Link to comment Share on other sites More sharing options...
finchy01 Posted April 20, 2020 Share Posted April 20, 2020 Hi, any more on this? Link to comment Share on other sites More sharing options...
Guest Posted April 20, 2020 Share Posted April 20, 2020 https://www.prestashop.com/forums/forum/235-job-offers/ All you need is enter the demand for repair and finding the problem. Link to comment Share on other sites More sharing options...
finchy01 Posted May 4, 2020 Share Posted May 4, 2020 For my 1.6 store -> Some webhosts have disabled anonymous sending recently so I had to configure my store to use custom SMTP settings and now it works. For my 1.7 store -> I had to configure custom SMTP settings and also configure the contact form settings (under Module Manager) to "Receive customers' messages by email" (for some reason this option is unchecked by default now). Thank you for your help. 3 Link to comment Share on other sites More sharing options...
Guest Posted May 5, 2020 Share Posted May 5, 2020 Thanks for the feedback. I suspected that web hosting did not have php mail enabled. Recently, many e-shops have been attacked by hackers and are sending spam. Link to comment Share on other sites More sharing options...
zod Posted August 18, 2020 Share Posted August 18, 2020 On 5/4/2020 at 11:25 PM, finchy01 said: For my 1.7 store -> I had to configure custom SMTP settings and also configure the contact form settings (under Module Manager) to "Receive customers' messages by email" (for some reason this option is unchecked by default now). Thank you! 1 hour wasted debugging and searching to finally discover this damn module with this damn option deactive!!! Why they did this in 1.7??? Who had the brilliant idea to deactive by default the email in the contact form??? Link to comment Share on other sites More sharing options...
skillboy Posted August 30, 2020 Share Posted August 30, 2020 php function mail() is available Array ( [type] => 8192 [message] => array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead [file] => /home/box/domains/gratisbox.nl/public_html/src/Adapter/EntityMapper.php [line] => 99 ) PHP mail is OK and send to [email protected] shop mail: [email protected] Link to comment Share on other sites More sharing options...
alihrphrp Posted August 30, 2020 Share Posted August 30, 2020 On 4/20/2020 at 11:28 AM, Guest said: https://www.prestashop.com/forums/forum/235-job-offers/ All you need is enter the demand for repair and finding the problem. thanks I am checking this post and will update here after seeing the post you have mentioned. Link to comment Share on other sites More sharing options...
Roman Bittner Posted September 4, 2020 Share Posted September 4, 2020 After several hours I solved the problem - at least on my site. I have PS 1.7.6.7. I changed line 421 in /modules/contactform/contactform.php from: null, to: '[email protected]', It changes the sender address from website address into another one. Of course, instead of '[email protected]' use any valid email for your domain. It seems like if the website main email is the same as sender address, then the mail will not reach the mailbox, although no error is displayed or logged. Here is the fixed code within its context: Link to comment Share on other sites More sharing options...
ZORANVEDEK Posted November 25, 2020 Share Posted November 25, 2020 Okay, I'm not too savvy with the PHP, but I was smart enough to go through and label all of the different places that throw up the phrase "An error occurred while sending the message, please try again" ....and from there I can locate what area is likely causing the error, or at least at which point it throws up the warning. The code in that area is: } elseif ($url !== '' || empty($serverToken) || $clientToken !== $serverToken || $clientTokenTTL < time() ) { $this->context->controller->errors[] = $this->trans( 'An error 1 occurred while sending the message, please try again.', [], 'Modules.Contactform.Shop' ); $this->createNewToken(); That #1 in there is the error that gets thrown back in both PHP and SMTP mail, I labeled them all 1-4, that one is on line 489 in modules/contactform.php in 1.7.6.9. I have tried both PHP and SMTP, I can get nothing, absolutely nothing to send, not from the form, not from a test email, nothing. However, the script provided by @Guest, does send an email, the form on the site does not. Again, any and all help is appreciated. Link to comment Share on other sites More sharing options...
NetzCom Posted January 14, 2021 Share Posted January 14, 2021 First of all check Modules->Contact form->Configure , Receive customers' messages by email and choose yes. 1 Link to comment Share on other sites More sharing options...
Hassan.e Posted January 15, 2021 Share Posted January 15, 2021 Having the same issue and not yet resolved. The contactform module config both enabled. Link to comment Share on other sites More sharing options...
alvesjc Posted August 5, 2021 Share Posted August 5, 2021 Hello. I'm fighting this issue also. I've it enabled in contact form and also customer service email set. But everytime I try to send email in adanced parameters -> email I get and error: Error: Please check your configuration Failed to authenticate on SMTP server with username "[email protected]" using 2 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Error: authentication failed: authentication failure ". Authenticator PLAIN returned Expected response code 235 but got code "535", with message "535 5.7.8 Error: authentication failed: authentication failure ". in var/log/mail.log Aug 5 01:39:37 server postfix/smtpd[19410]: connect from server. ddomain.com[x.x.x.x] Aug 5 01:39:40 server postfix/smtpd[19410]: warning: server. ddomain.com[x.x.x.x]: SASL LOGIN authentication failed: authentication failure Aug 5 01:39:41 server postfix/smtpd[19410]: warning: SASL authentication failure: Password verification failed Aug 5 01:39:41 server postfix/smtpd[19410]: warning: server. ddomain.com[x.x.x.x]: SASL PLAIN authentication failed: authentication failure Aug 5 01:39:41 server postfix/smtpd[19410]: lost connection after RSET from server. ddomain.com[x.x.x.x] Aug 5 01:39:41 server postfix/smtpd[19410]: disconnect from server. ddomain.com[x.x.x.x] ehlo=2 starttls=1 auth=0/2 rset=2 commands=5/7 I'm sure that username and password is correct. How can I further debug this ? Link to comment Share on other sites More sharing options...
Shabab Posted August 5, 2021 Share Posted August 5, 2021 Hi, Can you tell me your Prestashop version ? Link to comment Share on other sites More sharing options...
alvesjc Posted August 5, 2021 Share Posted August 5, 2021 Hi! PrestaShop version: 1.7.7.3 Server information Linux #157-Ubuntu SMP Fri Jul 9 23:07:57 UTC 2021 x86_64 Server software version: Apache/2.4.29 PHP version: 7.2.24-0ubuntu0.18.04.8 Memory limit: 2048M Max execution time: 600 Upload Max File size: 128M Thanks Link to comment Share on other sites More sharing options...
Shabab Posted August 5, 2021 Share Posted August 5, 2021 send me screenshot of smtp configuration. Link to comment Share on other sites More sharing options...
alvesjc Posted August 5, 2021 Share Posted August 5, 2021 info_outline Mail configuration Mail method: You are using your own SMTP parameters. SMTP server: server.domain.com SMTP username: Defined SMTP password: Defined Encryption: tls SMTP port: 587 I've tried also port 25 without encryption. Link to comment Share on other sites More sharing options...
abelhuda Posted August 22, 2022 Share Posted August 22, 2022 O que pode estar acontecendo na página de configuração de e-mail, é que o seu navegador "impõe" e-mail e senha de seu backoffice. Para solucionar, exclua este e-mail que está gravado no seu navegador e configure novamente os parâmetros smtp. Link to comment Share on other sites More sharing options...
bloggus Posted November 10, 2022 Share Posted November 10, 2022 On 5/4/2020 at 11:25 PM, finchy01 said: .... also configure the contact form settings (under Module Manager) to "Receive customers' messages by email" (for some reason this option is unchecked by default now). Thank you for that. I looked and looked, why the contact form didn't work. This did the trick!!! Link to comment Share on other sites More sharing options...
PPSA Posted February 10, 2023 Share Posted February 10, 2023 On 1/14/2021 at 11:08 AM, NetzCom said: First of all check Modules->Contact form->Configure , Receive customers' messages by email and choose yes. My mails were working perfectly and an update must have disabled them Link to comment Share on other sites More sharing options...
matracon Posted February 22, 2023 Share Posted February 22, 2023 In case it helps someone, my problem was the template, look for the file /httpdocs/themes/panda/modules/contactform/views/templates/widget/contactform.tpl, it was missing the hidden parameters at the end, replace that file with the original one It's in modules/contactform... 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