【发布时间】:2014-07-04 00:49:06
【问题描述】:
我想知道如何让这个 cakephp 电子邮件工作。我知识不多,但想知道我需要使用什么。我将为此使用我的网站电子邮件,例如 admin@website.com 但它能够通过 gmail 登录,因为它是这样设置的。谢谢。
<?php
class EmailConfig {
public $mail = array(
'transport' => 'Mail',
'from' => 'test@test.com',
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
);
public $smtp = array(
'transport' => 'Smtp',
'from' => array('site@localhost' => 'My Site'),
'host' => 'localhost',
'port' => 25,
'timeout' => 30,
'username' => 'user',
'password' => 'secret',
'client' => null,
'log' => false,
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
);
public $gmail = array(
'host' => 'ssl://smtp.gmail.com',
'port' => 465,
'username' => 'test@test.com',
'password' => 'myPass',
'transport' => 'Smtp'
);
public $fast = array(
'from' => 'you@localhost',
'sender' => null,
'to' => null,
'cc' => null,
'bcc' => null,
'replyTo' => null,
'readReceipt' => null,
'returnPath' => null,
'messageId' => true,
'subject' => null,
'message' => null,
'headers' => null,
'viewRender' => null,
'template' => false,
'layout' => false,
'viewVars' => null,
'attachments' => null,
'emailFormat' => null,
'transport' => 'Smtp',
'host' => 'localhost',
'port' => 25,
'timeout' => 30,
'username' => 'user',
'password' => 'secret',
'client' => null,
'log' => true,
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
);
}
【问题讨论】:
-
到目前为止你尝试过什么?你被困在哪里了?你需要更具体。
-
我不知道我需要编辑哪些字段。但我想看看任何帮助都会很棒