例子: //将发送邮件后的状态存入变量 $send_email_status=send_email($email,$subject,$content);
//判断进行操作的邮箱有没有,有的话把发送状态写入日志 if(!empty($send_email_status)){ $file = fopen('email.log','a+'); fwrite($file,date("Y-m-d H:i:s",time()).":发送邮箱{$email};当前状态:".($send_email_status===true?"发送成功":"发送失败ERROR:".$send_email_status)."\r\n"); fclose($file); }