$mailtitle = "{$diy->name}--留言通知"; $mailbody = ''; foreach($diy->getFieldList() as $field=>$fieldvalue) { $mailbody .= "{$fieldvalue[0]}:{${$field}} "; } $headers = "From: ".$cfg_adminemail."Reply-To: ".$cfg_adminemail; if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) { $mailtype = 'TXT'; require_once(DEDEINC.'/mail.class.php'); $smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password); $smtp->debug = false;//发送不成功把false改成1,再提交看错误信息 $smtp->sendmail($cfg_shoujianren,$cfg_webname ,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype); } else { @mail($cfg_shoujianren, $mailtitle, $mailbody, $headers); } |