Mail problem [SOLVED] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Mail problem [SOLVED] (/showthread.php?tid=81507) |
Mail problem [SOLVED] - JustJohnQ - 03-13-2022 Hello all, Below code works without problems: PHP Code: public function phpMail(){ PHP Code: public function ciMail() { "Unable to send email using PHP mail(). Your server might not be configured to send mail using this method." $fromEmail and $fromName are set in App\Config\Email.php. $protocol is set to 'mail'. Any help is aprreciated. John RE: Mail problem - captain-sensible - 03-14-2022 last time i read about using php mail() function i also read about various security concerns. I just use : https://github.com/PHPMailer/PHPMailer The good thing about it , is that on developing a web on local host , PHPMailer works and so i can play about with it also developing spam detector code so , i don't get too much spam. I have the PHPMailer directory at the same level as the app, public dirs etc and use autoload class so all the classes are found . Then in my controller that i use i have at the beginning Code: <?php namespace App\Controllers; RE: Mail problem - JustJohnQ - 03-15-2022 Thanks for your suggestion. I will try it out soon. In the mean time I solved the particular problem with the CI mail fuction. The server on which the application is running doesn't accept the fith argument sending mail ('-f '). I temporarily changed the mail function until I can implement a better solution. |