iemail.inc.t

来自「eGroupWare is a multi-user, web-based gr」· T 代码 · 共 59 行

T
59
字号
<?php/**************************************************************************** copyright            : (C) 2001-2003 Advanced Internet Designs Inc.* email                : forum@prohost.org* $Id: iemail.inc.t,v 1.2 2003/12/18 18:20:49 iliaa Exp $** This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or * (at your option) any later version.***************************************************************************/function validate_email($email){        return !preg_match('!([-_A-Za-z0-9\.]+)\@([-_A-Za-z0-9\.]+)\.([A-Za-z0-9]{2,4})$!', $email);}function send_email($from, $to, $subj, $body, $header=''){	if (empty($to) || !count($to)) {		return;	}	$body = str_replace('\n', "\n", $body);	if ($GLOBALS['FUD_OPT_1'] & 512) {		if (!class_exists('fud_smtp')) {			fud_use('smtp.inc');		}		$smtp = new fud_smtp;		$smtp->msg = str_replace("\n.", "\n..", $body);		$smtp->subject = $subj;		$smtp->to = $to;		$smtp->from = $from;		$smtp->headers = $header;		$smtp->send_smtp_email();	} else {		$bcc = '';		if (is_array($to)) {			$to = $to[0];			if (count($to) > 1) {				unset($to[0]);				$bcc = 'Bcc: ' . implode(', ', $to);			}		}		if ($header) {			$header = "\n" . str_replace("\r", "", $header);		} else if ($bcc) {			$bcc = "\n" . $bcc;		}		if (version_compare("4.3.3RC2", phpversion(), ">")) {			$body = str_replace("\n.", "\n..", $body);		}		mail($to, $subj, str_replace("\r", "", $body), "From: ".$from."\nErrors-To: ".$from."\nReturn-Path: ".$from."\nX-Mailer: FUDforum v".$GLOBALS['FORUM_VERSION'].$header.$bcc);	}}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?