CodeIgniter Forums
Create multiple email config - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29)
+--- Thread: Create multiple email config (/showthread.php?tid=91563)



Create multiple email config - warcooft - 08-29-2024

I have several email accounts from different vendors like gmail, outlook and others, is there a good way to create multiple email config so I can select one of them just like a database config?


RE: Create multiple email config - kenjis - 08-29-2024

See https://codeigniter.com/user_guide/libraries/email.html#setting-email-preferences-by-passing-an-array
You can pass an array of an email config.


RE: Create multiple email config - warcooft - 08-29-2024

@kenjis Thank you! I created a new config to load configurations from different vendors, then followed the user guide you provided then create new helper. It worked like a charm! Smile


RE: Create multiple email config - warcooft - 08-29-2024

I've created a package for that, if you want to try it, check it out here https://github.com/warcooft/codeigniter4-multi-smtp-config