开发者

CakePHP emails plugin - using a custom server

开发者 https://www.devze.com 2023-02-23 11:54 出处:网络
I am trying to make a sort of email client. I found the followi开发者_高级运维ng CakePHP datasource class: https://github.com/kvz/cakephp-emails-plugin

I am trying to make a sort of email client. I found the followi开发者_高级运维ng CakePHP datasource class: https://github.com/kvz/cakephp-emails-plugin

It seems very good, however I have one question regarding the server details. In the plugin's readme it says that you should add the IMAP server as a an entry into your database.php config file.

My problem is that, since my website allows users to choose their own IMAP server, I can't hardcode a specfic server into the config file.

How would I redesign the code (or perhaps you can change database settings from the controller) to fit my purposes?


not quite the same as when I first wrote it, but you can add database configs on the fly, see https://github.com/infinitas/infinitas/blob/beta/app_model.php#L371

you also might want to look at the original code as it does exactly what you want to do, https://github.com/infinitas/infinitas/tree/beta/core/emails

here is the actual code getting the emails of a particular users account https://github.com/infinitas/infinitas/blob/beta/core/emails/controllers/mail_systems_controller.php#L25

it also has all the code for users to add their account details etc.


Because it's a datasource, I believe you could simply set the imap server on the fly.

$this->emailTicket['server'] = $servername;
0

精彩评论

暂无评论...
验证码 换一张
取 消