Jump to content

a e-mail problem need your kindly help.


Recommended Posts

Hello All,
Just I had finished the Prestashop 1.2.0.2 version, but when used a while I can't send the mail access web site of contact us. and when I send the e-mail by contact us but get the below error.

There is 1 error :

an error occurred while sending message
« Back

also New installation Prestashop was ok, so I think my host server configured it's ok, but I can't found how to affect the problem. hope experts help check and kindly give advices, thanks.

BR
Henry

  • Like 2
Link to comment
Share on other sites

Hello Experts.

I had installed the 1.1 version test my web site. new installed web site the e-mail working fine. but after upload some products then web site

e-mail can't normal working. when I accessed the web site send the -email will got the below error.

=====================
Contact us

For questions about an order or for information about our products.

There is 1 error :

an error occurred while sending message

=========================

and now, how to resolve the problem? please kindly give advices, thanks so much!

BR,
Henry

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

I have the same problem with the new 1.2 Version and your above fix does work.
I even posted the problem, but they keep telling me it doesn't happen to them.

If you are a customer who is LOGGED INTO the site, and use the CONTACT US form it works fine, even fills in your on file email. However, if you are just a visitor on the site and try to use the form you WILL GET THE ERROR !!!!

This is the old code that WORKS !!!! Maybe Prestashop will realize the bug and actually correct it.

<?php

$useSSL = true;

include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/header.php');

$errors = array();

$smarty->assign('contacts', Contact::getContacts(intval($cookie->id_lang)));

if (Tools::isSubmit('submitMessage'))
{
   if (!($from = Tools::getValue('from')) OR !Validate::isEmail($from))
       $errors[] = Tools::displayError('invalid e-mail address');
   elseif (!($message = nl2br2(Tools::getValue('message'))))
       $errors[] = Tools::displayError('message cannot be blank');
   elseif (!Validate::isMessage($message))
       $errors[] = Tools::displayError('invalid message');
   elseif (!($id_contact = intval(Tools::getValue('id_contact'))) OR !(Validate::isLoadedObject($contact = new Contact(intval($id_contact), intval($cookie->id_lang)))))
       $errors[] = Tools::displayError('please select a contact in the list');
   else
   {
       if (Mail::Send(intval($cookie->id_lang), 'contact', 'Message from contact form', array('{email}' => $_POST['from'], '{message}' => stripslashes($message)), $contact->email))
           $smarty->assign('confirmation', 1);
       else
           $errors[] = Tools::displayError('an error occurred while sending message');
   }
}
$smarty->assign('errors', $errors);

$smarty->display(_PS_THEME_DIR_.'contact-form.tpl');
include(dirname(__FILE__).'/footer.php');

?>

Link to comment
Share on other sites

  • 3 months later...

for some reason, on the contact form, the email field has to be [email protected] or it will not send it.. if i use [email protected] it will not go thru.. why is it trying to send the email from the email customer enters, insted of sending from the 'emails from your shop address' in back office?

i just used this code up there and it did not work, btw

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