我试图从CakePHP发送电子邮件,但没有成功。我正在尝试使用CakeEmail和此代码:使用CakePHP发送电子邮件无法使用CakeEmail和SwiftMailer
$email = new CakeEmail();
$email->from(array('[email protected]' => __('Recruitment Job App')))
->to('[email protected]')
->subject(__('Recruitment Status Update'))
->send(__('Dear, ReynierPM this is a testing email'));
并且因为没有发送电子邮件而不起作用。该文件/app/Config/email.php有这样的配置:
class EmailConfig {
public $default = array(
'transport' => 'Debug',
'host' => 'smtp.gmail.com',
'port' => 25,
'timeout' => 30,
'username' => '[email protected]',
'password' => 'secret_password',
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
);
}
我也试试这个http://bakery.cakephp.org/articles/sky_l3ppard/2009/11/07/updated-swiftmailer-4-xx-component-with-attachments-and-plugins但在这种情况下,我得到这个错误:
Fatal error: Class 'testemailView' not found in /var/www/html/jobapp/app/Controller/Component/swift_mailer.php on line 245
我使用CakePHP 2.0 .6和SwiftMailer 4.1.5,有什么帮助? 欢呼声和提前致谢
致命错误似乎很清楚给我。 – 2012-02-27 04:02:36
哇,你这个笨蛋,在这样的公共网站上发布你的密码 – 2012-02-27 04:13:13
我想隐藏,但无论如何这是一个测试帐户,所以黑客去为它jajajaja – ReynierPM 2012-02-27 04:19:51