?? mailsend.jsp
字號(hào):
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="check.jsp" %>
<%@ page import="java.util.Date" %>
<%
Calendar now = Calendar.getInstance();
String sj2 = now.get(Calendar.YEAR)+"-"+(now.get(Calendar.MONTH)+1)+"-"+now.get(Calendar.DAY_OF_MONTH)+" "+now.get(Calendar.HOUR_OF_DAY)+":"+now.get(Calendar.MINUTE)+":"+now.get(Calendar.SECOND);
String sj = session.getAttribute("Uid")+"_"+now.get(Calendar.YEAR)+"-"+(now.get(Calendar.MONTH)+1)+"-"+now.get(Calendar.DAY_OF_MONTH)+" "+now.get(Calendar.HOUR_OF_DAY)+":"+now.get(Calendar.MINUTE)+":"+now.get(Calendar.SECOND);
String path = request.getRealPath("attached");
myUpload.setSavePath(path);
myUpload.setNewname(sj);
myUpload.doUpload(request,response);
String towho = myUpload.getFieldValue("towho");
String stowho = myUpload.getFieldValue("stowho");
String bywho = myUpload.getFieldValue("bywho");
String sbywho = myUpload.getFieldValue("sbywho");
String subject = myUpload.getFieldValue("subject");
String message = myUpload.getFieldValue("message");
// String kind = myUpload.getFieldValue("kind");
String fname = "no attached!";
String url = "";
if(myUpload.isUpload()){
fname = sj+"."+myUpload.getFileext();
url= "attached/"+fname;;
}
String sql;
boolean t = true;
// out.println("temp="+temp+" towho="+towho+" stowho="+stowho+" title="+title+" message="+message+" filename="+fname);
sql="select * from myuser where ID="+towho;
sqlbean.executeQuery(sql);
if( sqlbean.getTotalNum()<1) {
out.println(sqlbean.showMsg("javascript:history.back()","您所輸入的收信人不存在!","系統(tǒng)提示"));
t = false;
}
if(t){
sql = "insert into allmail (towho,stowho,userid,username,title,message,url,time,status,isread) values('"
+towho+"','"
+sqlbean.to_8859_1(stowho)+"','"
+session.getAttribute("Uid")+"','"
+sqlbean.to_8859_1(session.getAttribute("Uname").toString())+"','"
+sqlbean.to_8859_1(subject)+"','"
+sqlbean.to_8859_1(message)+"','"
+sqlbean.to_8859_1(url)+"','"+sj2+"',1,1)";
//為發(fā)件箱準(zhǔn)備
//out.println(sql);
sqlbean.executeUpdate(sql);
sql = "insert into allmail (towho,stowho,userid,username,title,message,url,time,status,isread) values('"
+session.getAttribute("Uid")+"','"
+sqlbean.to_8859_1(session.getAttribute("Uname").toString())+"','"
+towho+"','"
+sqlbean.to_8859_1(stowho)+"','"
+sqlbean.to_8859_1(subject)+"','"
+sqlbean.to_8859_1(message)+"','"
+sqlbean.to_8859_1(url)+"','"
+sj2+"',"
+"0,0)";//為收件箱做準(zhǔn)備
//out.println(sql);
sqlbean.executeUpdate(sql);
if(bywho!=null && sbywho!=null){
sql = "insert into allmail (towho,stowho,userid,username,title,message,url,time,status,isread) values('"
+bywho+"','"
+sqlbean.to_8859_1(sbywho)+"','"
+session.getAttribute("Uid")+"','"
+sqlbean.to_8859_1(session.getAttribute("Uname").toString())+"','"
+sqlbean.to_8859_1(subject)+"','"
+sqlbean.to_8859_1(message)+"','"
+sqlbean.to_8859_1(url)+"','"+sj2+"',1,1)";
//為發(fā)件箱準(zhǔn)備
//out.println(sql);
sqlbean.executeUpdate(sql);
sql = "insert into allmail (towho,stowho,userid,username,title,message,url,time,status,isread) values('"
+session.getAttribute("Uid")+"','"
+sqlbean.to_8859_1(session.getAttribute("Uname").toString())+"','"
+bywho+"','"
+sqlbean.to_8859_1(sbywho)+"','"
+sqlbean.to_8859_1(subject)+"','"
+sqlbean.to_8859_1(message)+"','"
+sqlbean.to_8859_1(url)+"','"
+sj2+"',"
+"0,0)";//為收件箱做準(zhǔn)備
sqlbean.executeUpdate(sql);
}
out.println(sqlbean.showMsg("javascript:window.close()","您的郵件已經(jīng)成功發(fā)送,正在關(guān)閉窗口!","系統(tǒng)提示"));
}
sqlbean.close();
%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -