var $subject; var $addr_to; var $text_body; var $text_encoded; var $mime_headers; var $mime_boundary = "--==================_846811060==_"; var " /> 国产在线观看黄色,一级毛片在线完整免费观看,国产亚洲精品午夜高清影院

一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

php 發送帶附件郵件示例

emailclass.php
復制代碼 代碼如下:
<?
class CMailFile {

var $subject;
var $addr_to;
var $text_body;
var $text_encoded;
var $mime_headers;
var $mime_boundary = "--==================_846811060==_";
var $smtp_headers;

function CMailFile($subject,$to,$from,$msg,$filename,$downfilename,$mimetype = "application/octet-stream",$mime_filename = false) {
$this->subject = $subject;
$this->addr_to = $to;
$this->smtp_headers = $this->write_smtpheaders($from);
$this->text_body = $this->write_body($msg);
$this->text_encoded = $this->attach_file($filename,$downfilename,$mimetype,$mime_filename);
$this->mime_headers = $this->write_mimeheaders($filename, $mime_filename);
}

function attach_file($filename,$downfilename,$mimetype,$mime_filename) {
$encoded = $this->encode_file($filename);
if ($mime_filename) $filename = $mime_filename;
$out = "--" . $this->mime_boundary . "/n";
$out = $out . "Content-type: " . $mimetype . "; name=/"$filename/";/n";
$out = $out . "Content-Transfer-Encoding: base64/n";
$out = $out . "Content-disposition: attachment; filename=/"$downfilename/"/n/n";
$out = $out . $encoded . "/n";
$out = $out . "--" . $this->mime_boundary . "--" . "/n";
return $out;
}

function encode_file($sourcefile) {
if (is_readable($sourcefile)) {
$fd = fopen($sourcefile, "r");
$contents = fread($fd, filesize($sourcefile));
$encoded = chunk_split(base64_encode($contents));
fclose($fd);
}
return $encoded;
}

function sendfile() {
$headers = $this->smtp_headers . $this->mime_headers;
$message = $this->text_body . $this->text_encoded;
mail($this->addr_to,$this->subject,$message,$headers);
}

function write_body($msgtext) {
$out = "--" . $this->mime_boundary . "/n";
$out = $out . "Content-Type: text/plain; charset=/"us-ascii/"/n/n";
$out = $out . $msgtext . "/n";
return $out;
}

function write_mimeheaders($filename, $mime_filename) {
if ($mime_filename) $filename = $mime_filename;
$out = "MIME-version: 1.0/n";
$out = $out . "Content-type: multipart/mixed; ";
$out = $out . "boundary=/"$this->mime_boundary/"/n";
$out = $out . "Content-transfer-encoding: 7BIT/n";
$out = $out . "X-attachments: $filename;/n/n";
return $out;
}

function write_smtpheaders($addr_from) {
$out = "From: $addr_from/n";
$out = $out . "Reply-To: $addr_from/n";
$out = $out . "X-Mailer: php3/n";
$out = $out . "X-Sender: $addr_from/n";
return $out;
}
}

/*用法 - 例如:mimetype 為 "image/gif"
$mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filename,$mimetype);
$mailfile->sendfile();

$subject -- 主題
$sendto -- 收信人地址
$replyto -- 回復地址
$message -- 信件內容
$filename -- 附件文件名
$downfilename -- 下 主站蜘蛛池模板: 欧美人与禽交片在线播放 | 狠狠色噜噜狠狠狠米奇9999 | 成人免费草草视频 | 亚洲区视频| 久久怡红院国产精品 | 91国语精品自产拍在线观看性色 | 国产成人精品微拍视频 | 国产精品嫩草影视在线观看 | 亚洲欧美国产精品 | 国产高清区 | 欧美系列第一页 | 激情图片小说网 | 看全色黄大色黄女片做 | 色呦呦在线免费观看 | 91热精品视频| 中国a毛片 | 欧美福利视频网站 | 国产美女视频 | 国产精品入口 | 免费在线观看黄网站 | 美女视频国产 | 色天使色婷婷在线影院亚洲 | 男人把女人c爽的免费视频 男人操女人免费视频 | 伊人网在线视频 | 免费国产最新进精品视频 | 中文国产成人精品少久久 | 亚洲视频网站在线观看 | 亚洲免费视频网址 | 国内精品91最新在线观看 | 久久久精品免费国产四虎 | 女人十八黄毛片 | 麻豆91视频 | 成人两性视频 | 朝鲜美女免费一级毛片 | 国产精品偷伦视频免费观看了 | 视频在线观看黄 | 色宅男中文字幕亚洲专区 | 国产精品视频99 | 99成人在线观看 | 中文字幕精品一区二区日本 | 婷婷中文在线 |