📄 newmsg.php
字号:
<?
/************************************************************************
UebiMiau is a GPL'ed software developed by
- Aldoir Ventura - aldoir@users.sourceforge.net
- http://uebimiau.sourceforge.net
Fell free to contact, send donations or anything to me :-)
S鉶 Paulo - Brasil
*************************************************************************/
require("./inc/inc.php");
echo($nocache);
if($tipo == "send") {
require("./inc/class.smtp.php");
$ARTo = $UM->get_names(stripslashes($to));
$ARCc = $UM->get_names(stripslashes($cc));
$ARBcc = $UM->get_names(stripslashes($bcc));
if((count($ARTo)+count($ARCc)+count($ARBcc)) > 0) {
$mail = new phpmailer;
// for password authenticated servers
if($use_password_for_smtp) {
$mail->UseAuthLogin($sess["user"],$sess["pass"]);
}
// if using the advanced editor
if($is_html == "true") {
$mail->IsHTML(1);
if($footer != "") {
$footer = ereg_replace("\n","",$footer); $footer = ereg_replace("\r","<br>\r\n",$footer);
$body .= $footer;
}
} elseif ($footer != "") $body .= $footer;
$mail->CharSet = $default_char_set;
$mail->IPAddress = getenv("REMOTE_ADDR");
$mail->timezone = $server_time_zone;
$mail->From = $sess["email"];
$mail->FromName = $UM->mime_encode_headers($prefs["real-name"]);
$mail->AddReplyTo($prefs["reply-to"], $UM->mime_encode_headers($prefs["real-name"]));
$mail->Host = $smtp_server;
$mail->WordWrap = 76;
$mail->Priority = $priority;
if(count($ARTo) != 0) {
for($i=0;$i<count($ARTo);$i++) {
$name = $ARTo[$i]["name"];
$email = $ARTo[$i]["mail"];
if($name != $email)
$mail->AddAddress($email,$UM->mime_encode_headers($name));
else
$mail->AddAddress($email);
}
}
if(count($ARCc) != 0) {
for($i=0;$i<count($ARCc);$i++) {
$name = $ARCc[$i]["name"];
$email = $ARCc[$i]["mail"];
if($name != $email)
$mail->AddCC($email,$UM->mime_encode_headers($name));
else
$mail->AddCC($email);
}
}
if(count($ARBcc) != 0) {
for($i=0;$i<count($ARBcc);$i++) {
$name = $ARBcc[$i]["name"];
$email = $ARBcc[$i]["mail"];
if($name != $email)
$mail->AddBCC($email,$UM->mime_encode_headers($name));
else
$mail->AddBCC($email);
}
}
if(is_array($attachs = $sess["attachments"])) {
for($i=0;$i<count($attachs);$i++) {
if(file_exists($attachs[$i]["localname"])) {
$mail->AddAttachment($attachs[$i]["localname"], $attachs[$i]["name"], $attachs[$i]["type"]);
}
}
}
$mail->Subject = $UM->mime_encode_headers(stripslashes($subject));
$mail->Body = stripslashes($body);
if(($resultmail = $mail->Send()) === false) {
$err = $mail->ErrorAlerts[count($mail->ErrorAlerts)-1];
$smarty->assign("umMailSent",false);
$smarty->assign("umErrorMessage",$err);
} else {
$smarty->assign("umMailSent",true);
if(is_array($attachs = $sess["attachments"])) {
for($i=0;$i<count($attachs);$i++) {
if(file_exists($attachs[$i]["localname"])) {
@unlink($attachs[$i]["localname"]);
}
}
unset($sess["attachments"]);
reset($sess);
$SS->Save($sess);
}
if($prefs["save-to-sent"]) {
if(!$UM->mail_connect()) { Header("Location: error.php?err=1&sid=$sid&tid=$tid&lid=$lid\r\n"); exit; }
if(!$UM->mail_auth(false)) { Header("Location: badlogin.php?sid=$sid&tid=$tid&lid=$lid\r\n"); exit; }
$UM->mail_save_message("sent",$resultmail,"\\SEEN");
unset($sess["headers"][base64_encode("sent")]);
$UM->mail_disconnect();
$SS->Save($sess);
}
}
} else die("<script language=\"javascript\">location = 'error.php?err=3&sid=$sid&tid=$tid&lid=$lid';</script>");
$jssource = "
<script language=\"javascript\">
function newmsg() { location = 'newmsg.php?pag=$pag&folder=".urlencode($folder)."&sid=$sid&tid=$tid&lid=$lid'; }
function folderlist() { location = 'folders.php?folder=".urlencode($folder)."&sid=$sid&tid=$tid&lid=$lid'}
function refreshlist() { location = 'msglist.php?refr=true&folder=".urlencode($folder)."&pag=$pag&sid=$sid&tid=$tid&lid=$lid' }
function goend() { location = 'logout.php?sid=$sid&tid=$tid&lid=$lid'; }
function goinbox() { location = 'msglist.php?folder=inbox&sid=$sid&tid=$tid&lid=$lid'; }
function emptytrash() { location = 'folders.php?empty=trash&folder=".urlencode($folder)."&goback=true&sid=$sid&tid=$tid&lid=$lid';}
function search() { location = 'search.php?folder=".urlencode($folder)."&sid=$sid&tid=$tid&lid=$lid';}
function addresses() { location = 'addressbook.php?sid=$sid&tid=$tid&lid=$lid'; }
function prefs() { location = 'preferences.php?sid=$sid&tid=$tid&lid=$lid'; }
</script>
";
$smarty->assign("umSid",$sid);
$smarty->assign("umLid",$lid);
$smarty->assign("umTid",$tid);
$smarty->assign("umJS",$jssource);
$smarty->display("neotech.net/newmsg-result.htm");
}else {
$priority_level = (!$priority)?3:$priority;
$uagent = $HTTP_SERVER_VARS["HTTP_USER_AGENT"];
$isMac = ereg("Mac",$uagent);
$isOpera = ereg("Opera",$uagent);
$uagent = explode("; ",$uagent);
$uagent = explode(" ",$uagent[1]);
$bname = strtoupper($uagent[0]);
$bvers = $uagent[1];
$show_advanced = (($bname == "MSIE") && (intval($bvers) >= 5) && (!$textmode) && (!$isMac) && (!$isOpera) && ($prefs["editor-mode"] != "text"))?1:0;
//$show_advanced = 0;
$js_advanced = ($show_advanced)?"true":"false";
$signature = $prefs["signature"];
if($show_advanced) $signature = nl2br($signature);
$add_sig = $prefs["add-sig"];
$umAddSig = ($add_sig)?1:0;
$forms = "<input type=hidden name=tipo value=edit>
<input type=hidden name=is_html value=\"$js_advanced\">
<input type=hidden name=sid value=\"$sid\">
<input type=hidden name=lid value=\"$lid\">
<input type=hidden name=folder value=\"$folder\">
<input type=hidden name=sig value=\"".htmlspecialchars($signature)."\">
<input type=hidden name=textmode value=\"$textmode\">
";
$jssource = "
<script language=\"javascript\">
bIs_html = $js_advanced;
bsig_added = false;
function addsig() {
with(document.composeForm) {
if(bsig_added || sig.value == '') return false;
if(cksig.checked) {
if(bIs_html) {
cur = GetHtml()
SetHtml(cur+'<br><br>--<br>'+sig.value);
} else
body.value += '\\r\\n\\r\\n--\\r\\n'+sig.value;
}
cksig.disabled = true;
bsig_added = true;
}
return true;
}
function upwin(rem) {
mywin = 'upload.php';
if (rem != null) mywin += '?rem='+rem+'&sid=$sid';
else mywin += '?sid=$sid&tid=$tid&lid=$lid';
window.open(mywin,'Upload','width=300,height=50,left=200,top=200,scrollbars=0,menubar=0,status=0');
}
function doupload() {
if(bIs_html) document.composeForm.body.value = GetHtml();
document.composeForm.tipo.value = 'edit';
document.composeForm.submit();
}
function textmode() {
with(document.composeForm) {
if(bIs_html) body.value = GetText();
textmode.value = 1;
tipo.value = 'edit';
submit();
}
}
function enviar() {
error_msg = new Array();
frm = document.composeForm;
check_mail(frm.to.value);
check_mail(frm.cc.value);
check_mail(frm.bcc.value);
errors = error_msg.length;
if(frm.to.value == '' && frm.cc.value == '' && frm.bcc.value == '')
alert('".ereg_replace("'","\\'",$error_no_recipients)."');
else if (errors > 0) {
if (errors == 1) errmsg = '".ereg_replace("'","\\'",$error_compose_invalid_mail1_s)."\\r\\r';
else errmsg = '".ereg_replace("'","\\'",$error_compose_invalid_mail1_p)."\\r\\r';
for(i=0;i<errors;i++)
errmsg += error_msg[i]+'\\r';
if (errors == 1) errmsg += '\\r".ereg_replace("'","\\'",$error_compose_invalid_mail2_s)."s';
else errmsg += '\\r".ereg_replace("'","\\'",$error_compose_invalid_mail2_p)."';
alert(errmsg)
} else {
if(bIs_html) frm.body.value = GetHtml();
frm.tipo.value = 'send';
frm.submit();
}
}
function newmsg() { location = 'newmsg.php?pag=$pag&folder=".urlencode($folder)."&sid=$sid&tid=$tid&lid=$lid'; }
function folderlist() { location = 'folders.php?folder=".urlencode($folder)."&sid=$sid&tid=$tid&lid=$lid'}
function goend() { location = 'logout.php?sid=$sid&tid=$tid&lid=$lid'; }
function goinbox() { location = 'msglist.php?folder=inbox&sid=$sid&tid=$tid&lid=$lid'; }
function emptytrash() { location = 'folders.php?empty=trash&folder=".urlencode($folder)."&goback=true&sid=$sid&tid=$tid&lid=$lid';}
function search() { location = 'search.php?folder=".urlencode($folder)."&sid=$sid&tid=$tid&lid=$lid';}
function addrpopup() { mywin = window.open('quick_address.php?sid=$sid&tid=$tid&lid=$lid','AddressBook','width=480,height=220,top=200,left=200'); }
function addrpopup_oa() { mywin = window.open('quick_address_oa.php?sid=$sid&tid=$tid&lid=$lid','AddressBook','width=480,height=220,top=200,left=200'); }
function addrpopup_oa_add() { mywin = window.open('quick_address_oa_add.php?sid=$sid&tid=$tid&lid=$lid','AddressBook','width=480,height=220,top=200,left=200'); }
function addresses() { location = 'addressbook.php?sid=$sid&tid=$tid&lid=$lid'; }
function prefs() { location = 'preferences.php?sid=$sid&tid=$tid&lid=$lid'; }
function AddAddress(strType,strAddress) {
obj = eval('document.composeForm.'+strType);
if(obj.value == '') obj.value = strAddress
else obj.value = obj.value + ', ' + strAddress
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -