为了提高发送邮件的成功率,我们完全可以使用第三方服务来实现发送邮件功能,其中比较典型的提供商就是国外的mailgun和国内的sendcloud,由于sendcloud 模板限制为30条,且每次模板修改都要经过审核,故只能放弃使用sendcloud。 mailgun 绑定信用卡后,每月
为了提高发送邮件的成功率,我们完全可以使用第三方服务来实现发送邮件功能,其中比较典型的提供商就是国外的mailgun和国内的sendcloud,由于sendcloud 模板限制为30条,且每次模板修改都要经过审核,故只能放弃使用sendcloud。
mailgun 绑定信用卡后,每月会赠送1万条邮件,对于小站来说基本够用,超出的部分也不贵。
有人可能会考虑sendcloud在国内的速度更快,mailgun在国外请求速度变慢,其实仔细一想,只要能收到国外的邮件,发送的速度慢点又何妨呢。
# 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)
立即学习“PHP免费学习笔记(深入)”;
© 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
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号