prestashop_newuser Posted July 14, 2014 Share Posted July 14, 2014 Hi, I am doing a small module in Prestashop. In that module I have used mail function for sending email to the admin. It is doing fine. But when I did validate the module using prestashop validator then it showed me an error like The use of function mail() is forbidden. So can someone kindly tell me how to solve this issue? Any help and suggestions will be realy appreciable. Thanks Link to comment Share on other sites More sharing options...
NemoPS Posted July 14, 2014 Share Posted July 14, 2014 You have to use Mail::Send, have a lok at classes/Mail.php 1 Link to comment Share on other sites More sharing options...
prestashop_newuser Posted July 14, 2014 Author Share Posted July 14, 2014 (edited) You have to use Mail::Send, have a lok at classes/Mail.php can you show me some examples for this? Should I have to include classes/Mail.php in my module code to use email? Edited July 14, 2014 by prestashop_newuser (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted July 14, 2014 Share Posted July 14, 2014 No no, it's read to use, have a look at the declaration: public static function Send($id_lang, $template, $subject, $template_vars, $to, $to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null, $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null) 1 Link to comment Share on other sites More sharing options...
diegopintovieira Posted July 14, 2014 Share Posted July 14, 2014 Hi, I am doing a small module in Prestashop. In that module I have used mail function for sending email to the admin. It is doing fine. But when I did validate the module using prestashop validator then it showed me an error like The use of function mail() is forbidden. So can someone kindly tell me how to solve this issue? Any help and suggestions will be realy appreciable. Thanks Hello, I need a module to send email alerts when a new message arrives in customer service. This module would serve what you are doing? Could you send me? Link to comment Share on other sites More sharing options...
NemoPS Posted July 16, 2014 Share Posted July 16, 2014 diegopintovieira, actually when a message is added to the customer service, it should be sent to an email as well, do you need to send it to multiple emails? Link to comment Share on other sites More sharing options...
diegopintovieira Posted July 16, 2014 Share Posted July 16, 2014 (edited) diegopintovieira, actually when a message is added to the customer service, it should be sent to an email as well, do you need to send it to multiple emails? I need just one, but the option does not send SMTP email alert to this email. Only option php mail function sends alerts, but the message I receive is to observe many errors in the attached image please. Link: http://pt-br.tinypic.com/view.php?pic=8vutn6&s=8#.U8ZljUAhOXk Edited July 16, 2014 by diegopintovieira (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted July 18, 2014 Share Posted July 18, 2014 It's weird, as both should use the same store address. What if you only try to send out emails in .txt format? Link to comment Share on other sites More sharing options...
diegopintovieira Posted July 18, 2014 Share Posted July 18, 2014 It's weird, as both should use the same store address. What if you only try to send out emails in .txt format? Hello Nemo1, I tried use only. txt and also only. html and the two continued to have the same problem. The option to use both too. Link to comment Share on other sites More sharing options...
Recommended Posts