CodeIgniter Forums
Config mail using settings - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Config mail using settings (/showthread.php?tid=91891)



Config mail using settings - pippuccio76 - 10-31-2024

HI,
is there a way to use https://github.com/codeigniter4/settings to config email instead of  Config/Email
i try to use : 
Code:
      service('settings')->set('Email.protocol', 'smtp');
      service('settings')->set('Email.SMTPHost', 'smtps.xxxxx.it');
      service('settings')->set('Email.SMTPUser', '[email protected]');
      service('settings')->set('Email.SMTPPass', 'xxxxxx');
      service('settings')->set('Email.SMTPPort', '465');
      service('settings')->set('Email.SMTPCrypto', 'ssl');
But if i try to send email i have no smtp configured


RE: Config mail using settings - InsiteFX - 10-31-2024

Library Reference Email Class - CodeIgniter 4 User Guide - Setting Email Preferences


RE: Config mail using settings - pippuccio76 - 11-01-2024

so i  can't use the database, right?


RE: Config mail using settings - warcooft - 11-01-2024

what have you done?
How do you do it?
what are the results like?


RE: Config mail using settings - InsiteFX - 11-01-2024

You can do it you just need to use an array and then initialize the Email Class.