【发布时间】:2012-07-18 21:23:21
【问题描述】:
我想使用内置函数从 CakePHP 发送纯文本和 html 电子邮件,但不接触 .ctp 文件。
这是我想要的 CakeEmail 的内容:
//Send email to user
$email = new CakeEmail('default');
$email->to($customers['Customer']['email']);
$email->subject('Password reset');
$email->htmlMessage('<div>Reset the password</div>');
$email->textMessage('Password the reset');
$email->send();
但显然,这些功能不存在,所以有人知道替代解决方案吗? 我不想碰 CakePHP 的 Email 文件夹,因为电子邮件的布局和内容是动态生成的。
蛋糕版 2.0.6
基本上,我想要此代码的 CakePHP 版本:http://www.daniweb.com/web-development/php/threads/2959/sending-htmlplain-text-emails 能够发送 HTML 和纯文本电子邮件
【问题讨论】:
-
从你的问题中不清楚你想要什么?有没有经过book.cakephp.org/2.0/en/core-utility-libraries/email.html?
-
cake2.2?请始终指定您的版本