<?php
class Mail
{
private $charset = "UTF-8";
private $boundary = "";
private $SubBody = array();
private $body = array();
private $ctencoding = "base64";
private $count_body = 1;
private $checkAddress = true;
private $headers = array();
private $ready_headers = array();
private $names_email = array();
private $receipt = 0;
private $smtpsendto = array();
private $sendto = array();
private $acc = array();
private $abcc = array();
private $smtp = array();
private $smtp_log = '';
private $log_on = false;
private $body_header = array();
public $status_mail = array('status' => true, "message" => 'ок');
public function __construct($charset = "", $ctencoding = '')
{
$this->boundary = md5(uniqid("myboundary"));
$this->smtp['on'] = false;
if (strlen($ctencoding) and $ctencoding == '8bit')
{
$this->ctencoding = '8bit';
}
if (strlen($charset))
{
$this->charset = strtolower($charset);
if ($this->charset == "us-ascii")
{
$this->ctencoding = "7bit";
}
}
}
public function Body($text, $text_html = "", $alternative_text = '', $resource = 'webi')
{
if (!strlen($resource))
$resource = 'webi';
if ($text_html == "html")
$text_html = "text/html";
else
$text_html = "text/plain";
if ($this->ctencoding == 'base64')
{
if (strlen($alternative_text))
$alternative_text = chunk_split(base64_encode($alternative_text));
if (strlen($text))
$text = chunk_split(base64_encode($text));
}
if (!strlen($alternative_text))
{
$body = "Content-Type: ".$text_html."; charset=".$this->charset."\r\n";
$body.="Content-Transfer-Encoding: ".$this->ctencoding."\r\n\r\n";
$body.=$text;
}
elseif (strlen($alternative_text) and $text_html == 'text/html')
{
$body = "Content-Type: multipart/alternative; boundary=ALT-".$this->boundary."\r\n\r\n";
$body.="--ALT-".$this->boundary."\r\n";
$body.="Content-Type: text/plain; charset=".$this->charset."\r\n";
$body.="Content-Transfer-Encoding: ".$this->ctencoding."\r\n\r\n";
$body.=$alternative_text."\r\n";
$body.="--ALT-".$this->boundary."\r\n";
$body.="Content-Type: text/html; charset=".$this->charset."\r\n";
$body.="Content-Transfer-Encoding: ".$this->ctencoding."\r\n\r\n";
$body.=$text."\r\n";
$body.="--ALT-".$this->boundary."--";
}
$this->SubBody[$resource]['body'][0] = $body;
}
protected function mime_content_type($file)
{
$ext = strtolower(substr(strrchr(basename($file), '.'), 1));
switch ($ext)
{
case 'jpg': return 'image/jpeg';
case 'jpeg': return 'image/jpeg';
case 'gif': return 'image/gif';
case 'png': return 'image/png';
case 'ico': return 'image/x-icon';
case 'txt': return 'text/plain';
default: return 'application/octet-stream';
}
}
public function Attach($filename, $new_name_filename = "", $filetype = "", $disposition = "", $resource = 'webi')
{
if (!strlen($resource))
$resource = 'webi';
if (!file_exists($filename))
{
return FALSE;
}
if (strlen($new_name_filename))
$basename = basename($new_name_filename);
else
$basename = basename($filename);
$charset_name = "=?".$this->charset."?B?".base64_encode($basename)."?=";
if (!strlen($filetype))
$filetype = $this->mime_content_type($basename);
$body = "Content-Type: ".$filetype."; name=\"$charset_name\"\r\n";
$body.="Content-Transfer-Encoding: base64\r\n";
if ($disposition == 'attachment')
{
$body.="Content-Disposition: attachment; filename=\"$charset_name\"\r\n";
}
$body.="Content-ID: <".$basename.">\r\n";
$body.="\r\n";
$body.=chunk_split(base64_encode(file_get_contents($filename)));
if ($disposition == 'attachment')
$this->SubBody[$resource]['mixed'][] = $body;
else
{
$this->SubBody[$resource]['body'][$this->count_body] = $body;
$this->count_body++;
}
}
public function BuildMail($resource = 'webi')
{
if (!strlen($resource))
$resource = 'webi';
$this->ready_headers[$resource] = '';
if (isset($this->SubBody[$resource]['body']))
$resource_body = $resource;
else
$resource_body = 'webi';
if (!is_array($this->sendto[$resource]) OR !count($this->sendto[$resource]))
{
$this->status_mail['status'] = false;
$this->status_mail['message'] = "Error : no recipient selected for ".$resource;
// return false;
}
if (!isset($this->body[$resource_body]))
{
if (count($this->SubBody[$resource_body]['body']) > 1)
{
$body = implode("\r\n--REL-".$this->boundary."\r\n", $this->SubBody[$resource_body]['body']);
$body = "Content-Type: multipart/related; boundary=REL-".$this->boundary."\r\n\r\n"
.'--REL-'.$this->boundary."\r\n".$body.'--REL-'.$this->boundary."--";
}
else
{
$body = $this->SubBody[$resource_body]['body'][0];
}
if (isset($this->SubBody[$resource_body]['mixed']) AND count($this->SubBody[$resource_body]['mixed']))
{
$bodymix = implode('--MIX-'.$this->boundary."\r\n", $this->SubBody[$resource_body]['mixed']);
$body = $body."\r\n--MIX-".$this->boundary."\r\n".$bodymix;
$body = "Content-Type: multipart/mixed; boundary=MIX-".$this->boundary."\r\n\r\n"
.'--MIX-'.$this->boundary."\r\n".$body.'--MIX-'.$this->boundary."--";
}
unset($this->SubBody[$resource_body]);
$temp_mass = explode("\r\n\r\n", $body);
$this->body_header[$resource_body] = $temp_mass[0];
unset($temp_mass[0]);
$this->body[$resource_body] = implode("\r\n\r\n", $temp_mass);
unset($temp_mass);
unset($body);
}
$temp_mass = array();
foreach ($this->sendto[$resource] as $key => $value)
{
if (strlen($this->names_email[$resource]['To'][$value]))
$temp_mass[] = "=?".$this->charset."?Q?".str_replace("+", "_", str_replace("%", "=", urlencode(strtr($this->names_email[$resource]['To'][$value], "\r\n", " "))))."?= <".$value.">";
else
$temp_mass[] = $value;
}
$this->headers[$resource]['To'] = implode(", ", $temp_mass);
if (isset($this->acc[$resource]) and count($this->acc[$resource]) > 0)
$this->headers[$resource]['CC'] = implode(", ", $this->acc[$resource]);
if (isset($this->abcc[$resource]) and count($this->abcc[$resource]) > 0)
$this->headers[$resource]['BCC'] = implode(", ", $this->abcc[$resource]);
if ($this->receipt)
{
if (isset($this->headers["Reply-To"]))
$this->headers["Disposition-Notification-To"] = $this->headers["Reply-To"];
else
$this->headers["Disposition-Notification-To"] = $this->headers['From'];
}
if ($this->charset != "")
{
$this->headers["Mime
没有合适的资源?快使用搜索试试~ 我知道了~
企业网站HTML源码-营销管理方案服务响应式网页模板.zip
共74个文件
jpg:26个
js:21个
css:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 162 浏览量
2024-03-23
09:43:22
上传
评论
收藏 1.25MB ZIP 举报
温馨提示
这套HTML源代码文件是一个完整的网页模板,适用于各种类型的网站。它采用了最新的HTML5和CSS3技术,具有响应式设计,能够适应不同设备的屏幕尺寸。此外,它还包含了丰富的JavaScript插件,可以实现各种复杂的交互效果。这套源代码文件还具有高度的可定制性。您可以根据自己的需求对页面进行布局调整、颜色更改以及内容替换,轻松打造出符合您项目风格的网站。同时,我们的代码结构清晰、注释详细,方便您学习和理解HTML、CSS和JavaScript等前端技术。您可能面临着课程设计、毕业设计等挑战。这套源代码文件将成为您的得力助手,帮助您展示自己的才华和技能。通过使用这套源代码文件,您可以轻松地完成网站搭建任务,为您的课程设计或毕业设计增添亮点。总的来说,这套HTML源代码文件是一个高效、实用、易用的工具,无论你是专业的网页设计师,还是业余的编程爱好者,都值得拥有。
资源推荐
资源详情
资源评论
收起资源包目录
企业网站HTML源码-营销管理方案服务响应式网页模板.zip (74个子文件)
企业网站HTML源码-营销管理方案服务响应式网页模板
html
js
TMForm.js 46KB
jquery-migrate-1.2.1.js 17KB
jquery.cookie.js 4KB
modal.js 7KB
jquery.mousewheel.min.js 1KB
isotope.min.js 35KB
jquery.simplr.smoothscroll.min.js 655B
html5shiv.js 2KB
device.min.js 3KB
tmstickup.js 2KB
superfish.js 7KB
owl.carousel.js 52KB
jquery.mobilemenu.js 2KB
jquery.easing.1.3.js 8KB
jquery.equalheights.js 1KB
jquery.js 94KB
jquery.mobile.customized.min.js 17KB
jquery.unveil.js 2KB
jquery.ui.totop.js 1KB
camera.js 68KB
script.js 6KB
css
style.css 16KB
isotope.css 266B
camera.css 5KB
owl.carousel.css 3KB
animate.css 71KB
contact-form.css 6KB
grid.css 6KB
ie.css 60B
touchTouch.css 3KB
mail
recaptchalib.php 10KB
MailHandler.php 3KB
libmail.php 28KB
contacts.html 12KB
services.html 12KB
index.html 14KB
about.html 13KB
images
index-1_img12.jpg 3KB
index_slide03.jpg 161KB
index-1_img04.jpg 14KB
index-1_img10.jpg 3KB
index_img02.png 5KB
index-1_img05.jpg 21KB
index-3_img02.jpg 51KB
index-2_img03.jpg 37KB
form-loader.gif 8KB
index_img01.png 6KB
grabbing.png 116B
index-1_img11.jpg 3KB
logo.png 4KB
index-1_img09.jpg 2KB
index-2_img06.jpg 44KB
index-1_img02.jpg 25KB
index-1_img08.jpg 11KB
index-1_img06.jpg 11KB
select.png 3KB
index-1_img13.jpg 3KB
camera-loader.gif 9KB
favicon.ico 1KB
index-2_img05.jpg 39KB
index_slide02.jpg 167KB
AjaxLoader.gif 1KB
index-2_img04.jpg 33KB
index-3_img01.jpg 66KB
index-1_img01.jpg 23KB
index-2_img01.jpg 47KB
index-2_img02.jpg 34KB
index-1_img14.jpg 3KB
preloader.gif 8KB
index-1_img03.jpg 19KB
index-3_img03.jpg 66KB
index_slide01.jpg 199KB
index-1_img07.jpg 15KB
blog.html 11KB
共 74 条
- 1
资源评论
DTcode7
- 粉丝: 4500
- 资源: 4093
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功