emmim44 Posted May 19, 2010 Share Posted May 19, 2010 Hey guyz, i am using prestashop contact form to mail a static code to users. How would I change code below so that it can send email to "from" field email address along with code.The email sent should have my site's logo in body along static code and some predefined message and a subject. $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'); else { if (intval($cookie->id_customer)) $customer = new Customer(intval($cookie->id_customer)); if (Mail::Send(intval($cookie->id_lang), 'contact', 'Message from contact form', array('{email}' => $_POST['from'], '{message}' => stripslashes('test')), $contact->email, $contact->name, $from, (intval($cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $from))) $smarty->assign('confirmation', 1); else $errors[] = Tools::displayError('an error occurred while sending message'); } } $email = Tools::safeOutput(Tools::getValue('from', ((isset($cookie) AND isset($cookie->email) AND Validate::isEmail($cookie->email)) ? $cookie->email : ''))); $smarty->assign(array( 'errors' => $errors, 'email' => $email )); Link to comment Share on other sites More sharing options...
mstiopa Posted May 20, 2010 Share Posted May 20, 2010 Edit classes/Mail.phpFind: if (!isset($from)) $from = $configuration['PS_SHOP_EMAIL']; Replace with: $from = $configuration['PS_MAIL_USER']; Or any other address email. Link to comment Share on other sites More sharing options...
emmim44 Posted May 20, 2010 Author Share Posted May 20, 2010 but i dont want to mess up with original mail setups. This new mail page will be independent.... is there any other way to do it? Link to comment Share on other sites More sharing options...
mstiopa Posted May 20, 2010 Share Posted May 20, 2010 You can also try to change the "PS_SHOP_EMAIL" in the configuration file.But I don't know how is it sending without smtp. I think it's still 'no-reply'. Link to comment Share on other sites More sharing options...
emmim44 Posted May 20, 2010 Author Share Posted May 20, 2010 i believe that i could not explain myself... we are no on the same page 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