cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.2 Contact Us page can't send email

Magento 2.2 Contact Us page can't send email

Upgraded Magento 1.9.2 to 2.2, mostly the site working is OK but I discovered that after the Submit button is pressed from the standard Contact Us page it throws an error

 

'An error occurred while processing your form. Please try again later.'

 

All the email addresses look correct from inside the Dashboard, I wrote a test PHP program to send an email to the same address and put the code in public_html, it worked. I was also able to send an email from the command line of the server to the same address. So this means PHP can send an email but it doesn't work from the form.

 

Any ideas on what could be wrong? I've searched this forum quite a bit and I can't find a solution for this particular problem.

14 REPLIES 14

Re: Magento 2.2 Contact Us page can't send email

@byron_stuart

 

Maybe, the CAPTCHA is enabled from backend but it is not appearing on the frontend.

Is CAPTCHA enabled in Contact Us page?

Check it from Stores > Configuration > Customers > Customer Configuration > CAPTCHA > Forms

 

If the Contact Us page is selected, deselect it then refresh the cache. 

Now try to submit your contact us page and check.

 

If it is not the case of CAPTCHA, remove your var/log files and submit your contact us form.

Then check your log files if it is showing any particular error?

 

 

If you find my answer useful, Please click Kudos & Accept as Solution.

Re: Magento 2.2 Contact Us page can't send email

Hello @byron_stuart

 

Have you checked the Magento error logs in var/log/ to see if there's anything about the "Please try again later" error. Please check and share if there any.

Manish Mittal
https://www.manishmittal.com/

Re: Magento 2.2 Contact Us page can't send email

This seems to be the related error

 

[2018-10-18 04:35:15] main.CRITICAL: Incorrect theme identification key {"exception":"[object] (InvalidArgumentException(code: 0): Incorrect theme identification key at /home/mrsthtno/public_html/vendor/magento/framework/View/Design/Theme/FlyweightFactory.php:60)"} []

Re: Magento 2.2 Contact Us page can't send email

Hello @byron_stuart,

 

There is look like your theme activation key issue. I think you have used third party theme on your store but activation key is not valid. Please enter valid key on it.

 

--
If my answer is useful, please Accept as Solution & give Kudos

Re: Magento 2.2 Contact Us page can't send email

It may have been a 3rd party theme (I just don't remember) in Magento 1.9.2.

 

In Magento 2.2 I'm using Luma, I changed it through Admin. Could it be that there are still references to the 1.9.2 theme, if yes what database entries do I need to change or remove?

Re: Magento 2.2 Contact Us page can't send email

I checked the CAPTCHA for 'Contact Us' and it's not there so maybe that means the cause of the problem is there's some left over entries in the database related to the template that was being used for 1.9.2.

Does anybody know what database entries I should be looking for?

Re: Magento 2.2 Contact Us page can't send email

Hello @byron_stuart,

 

We don't know which theme you are using. All theme have own database value so Can you please try to disable that extension and try it again. For disable extension run below command

 

php bin/magento module:disable Vendorname_Namespace
php bin/magento setup:upgrade

 

Here Vendorname_Namespace - It is sample module name you have to add all theme's extension.

 

Below command for generate static content and clear cache.

 

rm -rf pub/static/frontend/* pub/static/adminhtml/* var/cache/ var/generation/ var/page_cache/ var/view_preprocessed/ var/composer_home generated/
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f
chmod -Rf 777 pub/ var/
php bin/magento cache:clean

--
If my answer is useful, please Accept as Solution & give Kudos

Re: Magento 2.2 Contact Us page can't send email

Thank you that is helpful, I have no extensions enabled in Magento 2.2 but I do have some database leftovers as the data migration tool imported database entries from the 1.9.2 extensions.

 

I installed Magento 2.2 as a fresh installation and then imported all of the data using the migration tool but I did not copy any of the files for the extensions and I have not tried to reinstall any of the extensions. The only files I copied from 1.9.2 were the images.

 

The theme I was using in 1.9.2 I assume would not work in 2.2 anyway. Once I had installed 2.2 I went to Admin and changed the theme to Luma but there are a few strange errors that are occurring.

 

Does that make sense?

Re: Magento 2.2 Contact Us page can't send email

Also if I go to Content -> Configuration

I can edit Global and Main Website but if I try and save changes in Main Website Store I get an error 'Something went wrong while saving this configuration: Incorrect theme identification key'

 

This is with the theme set as Magento Luma, could this same issue be preventing me from sending emails?