$E
=&
$E
['M'];
$M
='<b>自动捕捉到有错误产生!</b><br><br><b>错误描述:</b><br> <b>'.
$M
['file'].'</b>的
第<b>'.
$M
['line'].'</b>行出现了类型为<b>'.
$M
['type'].'</b>的错误:<br> '.
$M
['message'].'<br><br><b>关键代码:</b><br>'.
$E
.'<br>'.self::now('Y-m-d H:i:s',time()).'<br>';
$M
=
Strtr
(
$ErrTpl
,Array('{$M}'=>
$M
));unSet(
$ErrTpl
);
$G
=seft::getG('SYS','config');
IF(!self::Mail2(
$G
['Spe'],'警告: '.
$G
['Tit'].'
出现 PHP 程式错误!',
$M
) And
SYS_DEBUG===True){
throw
new
Exception('警告: '.
$G
['Tit'].'
出现 PHP 程式错误!<br><br>'.
$M
);
}
IF(SYS_DEBUG) {
Echo
$M
;}
unSet(
$E
,
$M
,
$G
);
Die();
}
}
/**
发送电邮
参数:
收件人,邮件标题(不可有换行符),邮件内容(行与行之间必须用\n 分隔,每行不可超过 70 个
字符)
说明:
调用 PHP 内置函式 Mail
发送电邮
返回:
返回布尔值
用法:
$IsSend=Fun::Mail2($email,$tit,$msg);
/**/
Public Static Function Mail2(
$to
,
$tit
,
$msg
) {
IF(Filter_var(
$to
,FILTER_VALIDATE_EMAIL)==''){
throw
new
Exception('电邮地址错误!');
}
$tit
='=?UTF-8?B?'.
Base64_Encode
(
$tit
).'?=';
$msg
=
str_replace
("\n.","\n..",
$msg
);
//Windows 如果在一行开头发现一个句号则会被删掉,
要避免此问题将单个句号替换成两个句号