盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

PHP一个发送邮件的类

时间:2024/12/12作者:未知来源:盾怪网教程人气:

[摘要]现在很多主机空间都是IIS上执行PHP程序,大多不能直接用mail()发送邮件,有了这个类只要你有注册过邮箱,就可以随意的发送邮件,速度也不慢哦。//************************...
现在很多主机空间都是IIS上执行PHP程序,大多不能直接用mail()发送邮件,有了这个类只要你有注册过邮箱,就可以随意的发送邮件,速度也不慢哦。

//******************************
// smtp.php文件
//
//******************************
<?php
class smtp
{


    /* Public Variables */
    var $smtp_port;
    var $time_out;
    var $host_name;
    var $log_file;
    var $relay_host;
    var $debug;
    var $auth;
    var $user;
    var $pass;

    /* Private Variables */
    var $sock;

    /* Constractor */


    function smtp($relay_host = "", $smtp_port = 25,$auth = false,$user,$pass)
    {
        $this->debug = FALSE;
        $this->smtp_port = $smtp_port;
        $this->relay_host = $relay_host;
        $this->time_out = 30; //is used in fsockopen()
        
        #

        $this->auth = $auth;//auth
        $this->user = $user;
        $this->pass = $pass;
        
        #

        $this->host_name = "localhost"; //is used in HELO command
        $this->log_file = "";


        $this->sock = FALSE;


    }


    /* Main Function */


    function sendmail($to, $from, $subject = "", $body = "", $mailtype, $cc = "", $bcc = "", $additional_headers = "")
    {


        $mail_from = $this->get_address($this->strip_comment($from));
        $body = ereg_replace("(^

关键词:PHP一个发送邮件的类




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版