![]() |
SMTP problem ( same as codeigniter 3) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: SMTP problem ( same as codeigniter 3) (/showthread.php?tid=78459) |
SMTP problem ( same as codeigniter 3) - pippuccio76 - 01-22-2021 Hi ,sorry for english , thi is my function to send email to recover password with smtp : PHP Code: public function send_new_password_by_mail($email_to,$newpassword) The method return TRUE but no mail are send . In codeigniter 3 i must use phpmailer (with same credential work fine) . Must i use phpmailer in codeigniter 4 too ? RE: SMTP problem ( same as codeigniter 3) - demyr - 01-22-2021 Si, puoi usarlo anche con il CI 4.* Please follow this thread and the ways our friends showed how to use Phpmailer with CI4. It's pretty easy. Be careful with the app/config/autoload.php part. Saluti! * you can also use it with CI4 RE: SMTP problem ( same as codeigniter 3) - pippuccio76 - 01-22-2021 (01-22-2021, 09:45 AM)demyr Wrote: Si, puoi usarlo anche con il CI 4.*Ciao demyr ![]() namespace App\ThirdParty\phpmailer\src\PHPMailer\PHPMailer; in PHPMailer,SMTP,EXCEPTION,OAuth in controller where i must use : use App\ThirdParty\phpmailer\src\PHPMailer\PHPMailer\PHPMailer; use App\ThirdParty\phpmailer\src\PHPMailer\PHPMailer\Exception; use App\ThirdParty\phpmailer\src\PHPMailer\PHPMailer\SMTP; but i have this error : Class 'App\ThirdParty\phpmailer\src\PHPMailer\PHPMailer\PHPMailer' not found RE: SMTP problem ( same as codeigniter 3) - demyr - 01-22-2021 Ciao di nuovo, Upload the PHP Mailer folder at the same level with app-public-system etc folders. Autoload PHP: PHP Code: public $psr4 = [ Create a Controller with a name, per esempio, Sendmail.php PHP Code: <?php namespace App\Controllers; To show the success message within your view: PHP Code: <?php if (session('msg')) : ?> The message box is made with Bootstrap, you can change it easily. Hope it works Cordiali Saluti RE: SMTP problem ( same as codeigniter 3) - iRedds - 01-22-2021 oh, GOD. app/Config/Autoload.php property $psr4 add a pair (namespace => path) PHP Code: 'PHPMailer\PHPMailer' => APPPATH . 'ThirdParty/phpmailer/src' In a controller PHP Code: use PHPMailer\PHPMailer\PHPMailer RE: SMTP problem ( same as codeigniter 3) - pippuccio76 - 01-22-2021 (01-22-2021, 02:00 PM)iRedds Wrote: oh, GOD. I dont want autoload phpmailer but use or only where i want use why the class aren't round? RE: SMTP problem ( same as codeigniter 3) - iRedds - 01-22-2021 (01-22-2021, 02:03 PM)pippuccio76 Wrote: I dont want autoload phpmailer but use or only where i want use why the class aren't round? You just define a namespace. There is no autoload. RE: SMTP problem ( same as codeigniter 3) - MGatner - 01-25-2021 The Email class in CodeIgniter 4 is a barely-changed port from version 3. There is a complete rewrite in the works but for now it is likely any problems you had using the CI3 version will persist in CI4. That said I use the Email class daily without trouble, so you might just need to give it some more effort. RE: SMTP problem ( same as codeigniter 3) - pippuccio76 - 01-25-2021 (01-25-2021, 06:11 AM)MGatner Wrote: The Email class in CodeIgniter 4 is a barely-changed port from version 3. There is a complete rewrite in the works but for now it is likely any problems you had using the CI3 version will persist in CI4.I found the problem , It s a server problem about sender if i use a link as name the class ( or the server) dont send the mail RE: SMTP problem ( same as codeigniter 3) - Corsari - 01-25-2021 (01-22-2021, 02:00 PM)iRedds Wrote: oh, GOD. ![]() |