嘗試發送郵件,但是失敗了,請修改錯誤後重試!
<script language="javascript">
alert("您輸入的收件組格式錯誤!\r正確的格式是:'gr:001'");
history.back();
</script>
<p>
<%
response.end
else
thegroup=(mid(trim(strfieldvalue),4))
end if
end if
tmpSQL="select * from t_group where owner='"&session("myid")&"' and groupidowner='"&thegroup&"'"
'response.write tmpsql
set tmprs=server.CreateObject("ADODB.Recordset")
tmprs.Open tmpsql,conn
if tmprs.bof or tmprs.eof then
'沒有找到該組
%>
嘗試發送郵件,但是失敗了,請修改錯誤後重試!
<script language="javascript">
alert("您輸入的收件組<%=thegroup%>沒有找到!");
history.back();
</script>
<p>
<%
response.end
else
if tmprs("personnum")=0 then
'組內沒有使用者
%>
嘗試發送郵件,但是失敗了,請修改錯誤後重試!
<script language="javascript">
alert("您輸入的收件組<%=thegroup%>中目前沒有任何的使用者\n所以不能發送");
history.back();
</script>
<p>
<%
response.end
else
strFieldValue=trim(tmprs("groupempl"))
tmprs.close
set tmprs=nothing
end if
end if
end if
if instr(strfieldValue,"|") then
'組發
allsearch=replace(trim(strfieldValue),"|","','")
allsearch="'"&allsearch&"'"
tmpstring=trim(strfieldValue)&"|"
tosearch=""
do while len(tmpstring)>=5
tosearch=left(tmpstring,5)
tmpstring=mid(tmpstring,7)
if instr(tosearch,"|") then
'格式錯誤
%>
嘗試發送郵件,但是失敗了,請修改錯誤後重試!
<script language="javascript">
alert("您輸入的收件者格式錯誤!");
history.back();
</script>
<p>
<%
response.end
end if
tmpSQL="select * from (select userid from t_officer where userid in ("&allsearch&")) DERIVEDTBL where userid='"&tosearch&"'"
'response.write tmpsql
set tmprs=server.CreateObject("ADODB.Recordset")
tmprs.Open tmpsql,conn
if tmprs.eof or tmprs.bof then
%>
嘗試發送郵件,但是失敗了,請修改錯誤後重試!
<script language="javascript">
alert("您輸入的收件者<%=tosearch%>沒有找到!");
history.back();
</script>
<p>
<%
response.end
end if
tmprs.close
set tmprs=nothing
loop
strfieldValue=trim(strFieldValue)
else
if len(trim(strFieldValue))<>5 then
'格式不正確
%>
嘗試發送郵件,但是失敗了,請修改錯誤後重試!
<script language="javascript">
alert("您輸入的收件者<%=trim(strFieldValue)%>不正確!");
history.back();
</script>
<p>
<%
response.end
else
if isnumeric(trim(len(strFieldValue))) then
tmpSQL="select * from t_officer where userid='"&trim(strFieldValue)&"'"
set tmprs=server.CreateObject("ADODB.Recordset")
tmprs.Open tmpsql,conn
if tmprs.eof or tmprs.bof then
%>
嘗試發送郵件,但是失敗了,請修改錯誤後重試!
<script language="javascript">
alert("您輸入的收件者<%=trim(strFieldValue)%>沒有找到\r該員工可能還沒有註冊!");
history.back();
</script>
<p>
<%
response.end
end if
tmprs.close
set tmprs=nothing
strfieldValue=trim(strFieldValue)
else
%>
嘗試發送郵件,但是失敗了,請修改錯誤後重試!
<script language="javascript">
alert("您輸入的收件者<%=trim(strFieldValue)%>不正確!");
history.back();
</script>
<p> <%
response.end
end if
end if
end if
end if
strFieldValue=replace(strFieldValue,"<","<")
'response.write strfieldname
rs(STRFIELDNAME)=replace(strFieldValue,">",">")
binHTTPHeader=MIDB(binHTTPHeader,INSTRB( DataStart + 1, binHTTPHeader, divider ))
loop
'開始處理檔案資料
titem=0
rs("filesize_1")=0
rs("filesize_2")=0
rs("filesize_3")=0
Do while lenB(binHTTPHeader)>46
if INSTRB( binHTTPHeader, bnCRLF & bnCRLF )<>0 then
binHeaderData = LeftB(binHTTPHeader,INSTRB( binHTTPHeader, bnCRLF & bnCRLF )-1)
else
exit do
end if
strHeaderData=bin2str(binHeaderData)
'讀取上傳檔案的Content-Type
lngFileContentTypeStart=Instr(strHeaderData,"Content-Type:")+Len("Content-Type:")
strFileContentType=Trim(Mid(strHeaderData,lngFileContentTypeStart))
strFileContentType=Replace(strFileContentType,vbCRLF,vbNullString)
'讀取上傳的檔案名稱
if instr(strheaderdata,"filename=")>0 then
lngFileNameStart=Instr(strHeaderData,"filename="&chr(34))+Len("filename="&chr(34))
lngFileNameEnd=Instr(lngFileNameStart,strHeaderData,chr(34))
strFileName=Mid(strHeaderData,lngFileNameStart,lngFileNameEnd-lngFileNameStart)
strFileName=Trim(strFileName)
strFileName=Replace(strFileName,vbCRLF,vbNullString)
else
strfilename=""
end if
'讀取上傳檔案資料
DataStart = INSTRB( binHTTPHeader, bnCRLF & bnCRLF ) + 4
DataEnd = INSTRB( DataStart + 1, binHTTPHeader, divider ) - DataStart
If strFileName<>"" Then
if dataend>0 then
binFieldValue=MIDB( binHTTPHeader, DataStart, DataEnd )
'將上傳的檔案寫入資料庫
titem=titem+1
'response.write "titem:"&titem
rs("FileContentType_"&titem)=strFileContentType
rs("FileContent_"&titem).AppendChunk binFieldValue
rs("filesize_"&