码迷,mamicode.com
首页 > Web开发 > 详细

PHP邮件扩展:mailpp

时间:2014-12-23 12:40:11      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:

你还在使用PHPMailer吗?out了吧!

mailpp是用C++写成的一个PHP扩展,专门用来执行发送邮件的任务。

class mailpp {
    public function __construct();
    public function set_host_port($host,$port) ;
    public function set_user_password($user,$password);
    public function set_content_type($content_type);
    public function set_subject($subject);
    public function set_from($from,$fromname);
    //totype:{PRIMARY,CC,BCC}
    public function set_to($to,$totype,$toname);
    public function set_body($body);
    public function send();
    public function send_by_tls();
    public function send_by_ssl();
            
}

接口一目了然。

用法很简单:
$mailpp = new mailpp();
$mailpp->set_host_port($__config__["email"]["smtp"], $__config__["email"]["port"]);
$mailpp->set_user_password($__config__["email"]["user"], $__config__["email"]["password"]);
$mailpp->set_content_type("HTML");
$mailpp->set_from($__config__["email"]["from"], $__config__["email"]["name"]);
$mailpp->set_to("****@qq.com", "BCC", "QQ1");
$mailpp->set_to("****@163.com", "BCC", "163");
$mailpp->set_to("****@qq.com", "CC", "QQ2");
$mailpp->set_to("****@gmail.com", "PRIMARY", "GMAIL");
$mailpp->set_subject("抄送,密送功能");
$mailpp->set_body("<html><head></head><body><p>mailpp发邮件!</p></body></html>");
$ok = $mailpp->send_by_ssl();

mailpp提供三种发送方法:send,send_by_ssl,和send_by_tls。可根据具体配置自行选择。

下载地址:http://www.wqbuyer.com/demo/blog/3.html.


PHP邮件扩展:mailpp

标签:

原文地址:http://my.oschina.net/wqbuyer/blog/359470

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!