作者:塑料调色cz | 来源:互联网 | 2018-05-13 17:06
为了提高发送邮件的成功率,我们完全可以使用第三方服务来实现发送邮件功能,其中比较典型的提供商就是国外的mailgun和国内的sendcloud,由于sendcloud模板限制为30条,且每次模板修改都要经过审核,故只能放弃使用sendcloud。mailgun绑定信用卡后,每月
为了提高发送邮件的成功率,我们完全可以使用第三方服务来实现发送邮件功能,其中比较典型的提供商就是国外的mailgun和国内的sendcloud,由于sendcloud 模板限制为30条,且每次模板修改都要经过审核,故只能放弃使用sendcloud。 mailgun 绑定信用卡后,每月
为了提高发送邮件的成功率,我们完全可以使用第三方服务来实现发送邮件功能,其中比较典型的提供商就是国外的mailgun和国内的sendcloud,由于sendcloud 模板限制为30条,且每次模板修改都要经过审核,故只能放弃使用sendcloud。
mailgun 绑定信用卡后,每月会赠送1万条邮件,对于小站来说基本够用,超出的部分也不贵。
有人可能会考虑sendcloud在国内的速度更快,mailgun在国外请求速度变慢,其实仔细一想,只要能收到国外的邮件,发送的速度慢点又何妨呢。
通过 mailgun API 发送邮件
# Include the Autoloader (see "Libraries" for install instructions)
require 'vendor/autoload.php';
use Mailgun\Mailgun;
# Instantiate the client.
$mgClient = new Mailgun('key-3ax6xnjp29jd6fds4gc373sgvjxteol0');
$domain = "samples.mailgun.org";
# Make the call to the client.
$result = $mgClient->sendMessage($domain, array(
'from' => 'Excited User ',
'to' => 'Baz ',
'subject' => '邮件标题',
'text' => '邮件内容',
));
这个API看起来很类似REST WebService API,简单而快捷。
(...)
Read the rest of 使用 PHP mailgun 发送邮件 (105 words)
© Li Xi for LixiPHP, 2014. |
Permalink |
No comment |
Add to
del.icio.us
Post tags: API, mailgun, sendmail, SMTP
Feed enhanced by Better Feed from Ozh