我用cakephp 2.2.3开发了一个web应用程序。我使用的那个应用程序是CakeEmail。但现在我想实现电子邮件传递的SparkPost插件。
我花了很多时间在谷歌上,但没有得到任何满意的结果。所有这些都是我发现的cakephp 3.0或更高版本的代码。
下面我发布了一些cakephp 3.x的链接-
https://github.com/syntaxera/cakephp-sparkpost-plugin
https://github.com/narendravaghela/cakephp-sparkpost
请帮助我,并告诉我关于在cakephp 2.x中实现sparkpost的任何想法。
发布于 2016-09-05 17:23:51
所以你可以通过configure CakePHP来实现。下面是一个(猜测过的)配置节:
class EmailConfig {
public $sparkpost = array(
'host' => 'smtp.sparkpostmail.com',
'port' => 587,
'username' => 'SMTP_Injection',
'password' => 'YOUR_API_KEY_WITH_SMTP_PRIVILEGES',
'transport' => 'Smtp',
'tls' => true
);
}然后在您的控制器代码中,您将使用上面命名的配置节实例化一个CakeEmail实例:
$email = new CakeEmail();
$email->config('sparkpost');
$email->from(...)->to(...)->subject(...)->send();https://stackoverflow.com/questions/39286144
复制相似问题