首页 > PHP教程 > 邮件处理 > 正文:详细讲解PHP的Jmai组件及发送邮件实例

详细讲解PHP的Jmai组件及发送邮件实例

web学习吧 2007-09-19 来源: 收藏本文
共7页: 上一页 [1] [2] 3 [4] [5] [6] [7] 下一页          $TO = explode(",", $this->strip_comment($to));
        if ($cc != "") {
            $TO = array_merge($TO, explode(",", $this->strip_comment($cc)));
        }
        if ($bcc != "") {
            $TO = array_merge($TO, explode(",", $this->strip_comment($bcc)));
        }
        $sent = TRUE;
        foreach ($TO as $rcpt_to) {
            $rcpt_to = $this->get_address($rcpt_to);
            if (!$this->smtp_sockopen($rcpt_to)) {
                $this->log_write("Error: Cannot send email to ".$rcpt_to."\n");
                $sent = FALSE;
                continue;
            }
            if ($this->smtp_send($this->host_name, $mail_from, $rcpt_to, $header, $body)) {
                $this->log_write("E-mail has been sent to <".$rcpt_to.">\n");
            } else {
                $this->log_write("Error: Cannot send email to <".$rcpt_to.">\n");
                $sent = FALSE;
            }
            fclose($this->sock);
            $this->log_write("Disconnected from remote host\n");
        }
        return $sent;
    }
/* Private Functions */
    function smtp_send($helo, $from, $to, $header, $body = "")
    {
        if (!$this->smtp_putcmd("HELO", $helo)) {
            return $this->smtp_error("sending HELO command");
        }
        #auth
        if($this->auth){

共7页: 上一页 [1] [2] 3 [4] [5] [6] [7] 下一页
热点教程
实用信息推荐
网站地图 - 最新教程 - RSS订阅 - 版权所有 - 广告服务 - 友情连接 - 联系我们