⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newmsg.php

📁 极限网络智能办公系统—MYOA26—100%—源程序。
💻 PHP
📖 第 1 页 / 共 2 页
字号:
			exit( "<script>location = 'msglist.php?err=2&folder=".urlencode( $folder )."&pag={$pag}&sid={$sid}&tid={$tid}&lid={$lid}&refr=true';</script>" );
		}
		else
		{
			$result = $UM->_read_file( $filename );
			$email = $UM->decode( $result );
			$result = $UM->fetch_structure( $result );
			$tmpbody = $email['body'];
			$subject = $mail_info['subject'];
			$ARFrom = $email['from'];
			$useremail = $sess['email'];
			$name = $ARFrom[0]['name'];
			$thismail = $ARFrom[0]['mail'];
			$fromreply = "\"{$name}\" <{$thismail}>";
			$ARTo = $email['to'];
			$i = 0;
			for ( ;	$i < count( $ARTo );	++$i	)
			{
				$name = $ARTo[$i]['name'];
				$thismail = $ARTo[$i]['mail'];
				if ( isset( $toreply ) )
				{
					$toreply .= ", \"{$name}\" <{$thismail}>";
				}
				else
				{
					$toreply = "\"{$name}\" <{$thismail}>";
				}
			}
			$ARCC = $email['cc'];
			$i = 0;
			for ( ;	$i < count( $ARCC );	++$i	)
			{
				$name = $ARCC[$i]['name'];
				$thismail = $ARCC[$i]['mail'];
				if ( isset( $ccreply ) )
				{
					$ccreply .= ", \"{$name}\" <{$thismail}>";
				}
				else
				{
					$ccreply = "\"{$name}\" <{$thismail}>";
				}
			}
			function clear_names( $strMail )
			{
				global $UM;
				$strMail = $UM->get_names( $strMail );
				$i = 0;
				for ( ;	$i < count( $strMail );	++$i	)
				{
					$thismail = $strMail[$i];
					$thisline = $thismail['mail'] != $thismail['name'] ? "\"".$thismail['name']."\""." <".$thismail['mail'].">" : $thismail['mail'];
					if ( $thismail['mail'] != "" && strpos( $result, $thismail['mail'] ) === false )
					{
						if ( $result != "" )
						{
							$result .= ", ".$thisline;
						}
						else
						{
							$result = $thisline;
						}
					}
				}
				return $result;
			}
			$allreply = clear_names( $fromreply.", ".$toreply );
			$ccreply = clear_names( $ccreply );
			$fromreply = clear_names( $fromreply );
			$msgsubject = $email['subject'];
			$fromreply_quote = $fromreply;
			$toreply_quote = $toreply;
			$ccreply_quote = $ccreply;
			$msgsubject_quote = $msgsubject;
			if ( $show_advanced )
			{
				$fromreply_quote = htmlspecialchars( $fromreply_quote );
				$toreply_quote = htmlspecialchars( $toreply_quote );
				$ccreply_quote = htmlspecialchars( $ccreply_quote );
				$msgsubject_quote = htmlspecialchars( $msgsubject_quote );
				$linebreak = "<br>";
			}
			else
			{
				$tmpbody = strip_tags( $tmpbody );
				$quote_string = "> ";
				$tmpbody = $quote_string.ereg_replace( "\n", "\n{$quote_string}", $tmpbody );
			}
			$body = "\r\n{$reply_delimiter}{$linebreak}\r\n{$reply_from_hea} ".ereg_replace( "(\")", "", $fromreply_quote )."{$linebreak}\r\n{$reply_to_hea} ".ereg_replace( "(\")", "", $toreply_quote );
			if ( !empty( $ccreply ) )
			{
				$body .= "{$linebreak}\r\n{$reply_cc_hea} ".ereg_replace( "(\")", "", $ccreply_quote );
			}
			$body .= "{$linebreak}\r\n{$reply_subject_hea} ".$msgsubject_quote."{$linebreak}\r\n{$reply_date_hea} ".@strftime( $date_format, $email['date'] )."{$linebreak}\r\n{$linebreak}\r\n{$tmpbody}";
			if ( $show_advanced )
			{
				$body = "\r\n<br>\r\n<BLOCKQUOTE dir=ltr style=\"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px\">\r\n  <DIV style=\"FONT: 10pt arial\">\r\n  {$body}\r\n  </DIV>\r\n</BLOCKQUOTE>\r\n";
			}
			switch ( $rtype )
			{
			case "reply" :
				if ( !eregi( "^{$reply_prefix}", trim( $subject ) ) )
				{
					$subject = "{$reply_prefix} {$subject}";
				}
				$to = $fromreply;
				break;
			case "replyall" :
				if ( !eregi( "^{$reply_prefix}", trim( $subject ) ) )
				{
					$subject = "{$reply_prefix} {$subject}";
				}
				$to = $allreply;
				$cc = $ccreply;
				break;
			case "forward" :
				if ( !eregi( "^{$forward_prefix}", trim( $subject ) ) )
				{
					$subject = "{$forward_prefix} {$subject}";
				}
				if ( !( 0 < count( $email['attachments'] ) ) )
				{
					break;
				}
				$bound = $email['attachments'][0]['boundary'];
				if ( $bound != "" )
				{
					$parts = $UM->split_parts( $bound, $result['body'] );
				}
				else
				{
					$parts[0] = $result['body'];
				}
				$i = 0;
				for ( ;	$i < count( $email['attachments'] );	++$i	)
				{
					$current = $email['attachments'][$i];
					$currentstruc = $UM->fetch_structure( $parts[$current['part']] );
					$tmpfilename = $userfolder."_attachments/".uniqid( "" ).".tmp";
					$contenttype = $current['content-type'] != "" ? $current['content-type'] : "application/octet-stream";
					$filename = $current['name'] != "" ? $current['name'] : basename( $tmpfilename );
					$UM->save_attach( $currentstruc['header'], $currentstruc['body'], $tmpfilename );
					$ind = count( $sess['attachments'] );
					$sess['attachments'][$ind]['localname'] = $tmpfilename;
					$sess['attachments'][$ind]['name'] = $filename;
					$sess['attachments'][$ind]['type'] = $contenttype;
					$sess['attachments'][$ind]['size'] = filesize( $tmpfilename );
				}
				$SS->save( $sess );
			}
			if ( $add_sig && !empty( $signature ) )
			{
				if ( $show_advanced )
				{
					$body = "<br><br>--<br>{$signature}<br><br>{$body}";
				}
				else
				{
					$body = "\r\n\r\n--\r\n{$signature}\r\n\r\n{$body}";
				}
			}
		}
	}
	else if ( $add_sig && !empty( $signature ) && empty( $body ) )
	{
		if ( $show_advanced )
		{
			$body = "<br><br>--<br>{$signature}<br><br>{$body}";
		}
		else
		{
			$body = "\r\n\r\n--\r\n{$signature}\r\n\r\n{$body}";
		}
	}
	$haveSig = empty( $signature ) ? 0 : 1;
	$smarty->assign( "umHaveSignature", $haveSig );
	$strto = isset( $nameto ) && eregi( "([-a-z0-9_\$+.]+@[-a-z0-9_.]+[-a-z0-9_])", $mailto ) ? "<input class=textbox style=\"width : 200px;\" type=text size=20 name=to value=\"&quot;".htmlspecialchars( stripslashes( $nameto ) )."&quot; <".htmlspecialchars( stripslashes( $mailto ) ).">\">\r\n\t" : "<input class=textbox style=\"width : 200px;\" type=text size=20 name=to value=\"".htmlspecialchars( stripslashes( $to ) )."\">";
	$strcc = "<input class=textbox style=\"width : 200px;\" type=text size=20 name=cc value=\"".htmlspecialchars( stripslashes( $cc ) )."\">";
	$strbcc = "<input class=textbox style=\"width : 200px;\" type=text size=20 name=bcc value=\"".htmlspecialchars( stripslashes( $bcc ) )."\">";
	$strsubject = "<input class=textbox style=\"width : 200px;\" type=text size=20 name=subject value=\"".htmlspecialchars( stripslashes( $subject ) )."\">";
	$haveAttachs = is_array( $attachs = $sess['attachments'] ) && count( $sess['attachments'] ) != 0 ? 1 : 0;
	$smarty->assign( "umHaveAttachs", $haveAttachs );
	if ( is_array( $attachs = $sess['attachments'] ) && count( $sess['attachments'] ) != 0 )
	{
		$attachlist = array( );
		$i = 0;
		for ( ;	$i < count( $attachs );	++$i	)
		{
			$index = count( $attachlist );
			$attachlist[$index]['name'] = $attachs[$i]['name'];
			$attachlist[$index]['size'] = ceil( $attachs[$i]['size'] / 1024 );
			$attachlist[$index]['type'] = $attachs[$i]['type'];
			$attachlist[$index]['link'] = "javascript:upwin({$i})";
		}
		$smarty->assign( "umAttachList", $attachlist );
	}
	if ( !$show_advanced )
	{
		$body = stripslashes( $body );
	}
	$umAdvEdit = $show_advanced ? 1 : 0;
	$smarty->assign( "umBody", $body );
	$smarty->assign( "umTo", $strto );
	$smarty->assign( "umCc", $strcc );
	$smarty->assign( "umBcc", $strbcc );
	$smarty->assign( "umSubject", $strsubject );
	$smarty->assign( "umTextEditor", $txtarea );
	$smarty->assign( "umAdvancedEditor", $umAdvEdit );
	$smarty->display( "neotech.net/newmsg.htm" );
}
echo "\r\n";
?>

⌨️ 快捷键说明

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