search
Homephp教程php手册PHP通过Eamil邮件发送出错信息

PHP通过Eamil邮件发送出错信息

Jun 13, 2016 am 09:37 AM
phpnoinformationErrorsendCommonly usedpassmail

   PHP通过Eamil邮件发送出错信息,觉得不是很常用,不过做为经常搞PHP项目,先留着自己以后参考。

  view sourceprint?01

  02//自定义处理程序

  03function nettuts_error_handler($number, $message, $file, $line, $vars){

  04 $email = "

  05

  An error ($number) occurred on line

  06 $line and in the file: $file.

  07

  $message

  ";

  08 $email .= "

  " . print_r($vars, 1) . "

  ";

  09 $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

  10 error_log($email, 1, 'you@youremail.com', $headers);

  11 if ( ($number !== E_NOTICE) && ($number

  12 die("有错误,请稍后再试!.");

  13 }

  14}

  15set_error_handler('nettuts_error_handler');

  16echo $somevarthatdoesnotexist;

  17?>

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment