超碰人人人人人,色婷婷综合久久久久中文一区二区,国产-第1页-浮力影院,欧美老妇另类久久久久久

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

ASP寫的JMail組件的郵件收取

admin
2010年2月1日 22:56 本文熱度 11152










郵件接受中,請稍后……


<%
response.Flush
Dim EmailUserName,EmailUserPass,EmailUserPOP,IfDelete
set rs=conn.execute("select * from MyDesktop_IMAccount where AccountCode='"&request("code")&"' and UserID='"&session("userid")&"'")
EmailUserName=rs("Account")
EmailUserPass=rs("Password")
EmailUserPOP=rs("Pop3Server")
IfDelete=rs("ifdelete")
rs.close
if EmailUserPass="" then
EmailUserPass=request("password")
if EmailUserPass="" then
response.write ""
response.end
end if
end if
Dim POP3,J '下載并閱讀郵件。
'------------------------
Set POP3 = Server.CreateObject("JMail.POP3")
POP3.Connect EmailUserName,EmailUserPass,EmailUserPOP
POP3.DownloadHeaders
set rs=server.createobject("adodb.recordset")
rs.open "select * from MyDesktop_IM",conn,1,3,1
if pop3.count>0 then
for J=1 to pop3.count

Dim Subject,MSGBody,MSGHTMLBody,MSGFrom,MSGFromName,ReTo,ReCC,FileUrl,FileName,AcceptTime

Subject=POP3.Messages.Item(J).Subject '郵件主題
MSGFrom=POP3.Messages.Item(J).From '發(fā)件人郵箱
MSGFromName=POP3.Messages.Item(J).FromName '發(fā)件人

Call getAttachments(J) '存儲附件

response.write "
"&Subject

rs.addnew()
rs("AccountCode")=Request("code")
rs("SendMail")=MSGFrom
rs("SendMailName")=MSGFromName
rs("AcceptMail")=ReTo
rs("CopyMail")=ReCC
rs("ClassCode")=1
rs("MailTitle")=Subject
if MSGHTMLBody="" then
rs("MailBody")=replace(MSGBody,chr(10),"
")
else
rs("MailBody")=MSGHTMLBody
end if
rs("FileUrl")=FileUrl
rs("FileName")=FileName
rs("SendAcceptTime")=AcceptTime
rs("MailState")=1
rs.update()
next
end if
rs.close
Set Attachments=Nothing
Set TheMsg=Nothing
if ifdelete then
POP3.DeleteMessages
end if
POP3.Disconnect
Set POP3=Nothing
endconn()
Response.write "" '轉(zhuǎn)到收件箱

'---------將附件存儲到本地服務(wù)器------------------
Sub getAttachments(J)
Dim Path,AT,separator,i,iPath,Att,POP,Re
Set POP = Server.CreateObject("JMail.POP3")
POP.Connect EmailUserName,EmailUserPass,EmailUserPOP

MSGBody=POP.Messages.Item(J).Body '純文本內(nèi)容
MSGHTMLBody=POP.Messages.Item(J).HTMLBody '超文本內(nèi)容
MSGBody=Trim(MSGBody)
MSGHTMLBody=Trim(MSGHTMLBody)
AcceptTime=POP.Messages.Item(J).Date '接收時間

FileName=""
FileUrl=""
ReTo=""
ReCC=""
Set Att = POP.Messages.Item(J).Attachments
separator = ","
if Att.Count>0 then
For i = 0 To Att.Count-1
If i = Att.Count-1 Then
separator = ""
End If
Set AT = Att.item(i)
if AT.Name<>".msg" then
Path="/EMail/attachments/" & iRandom & "/"
Call CreateAFolder(Server.Mappath(Path))
iPath=Server.Mappath(Path) & "\" & AT.Name
AT.SaveToFile(iPath)
FileUrl = FileUrl & Path & AT.Name & separator
FileName = FileName & AT.Name & separator
else
if MSGHTMLBody="" then
MSGHTMLBody=AT.data
end if
end if
Next
end if
'--------------收件人------------
Set Recipients = POP.Messages.Item(J).Recipients
separator = ","
For i = 0 To Recipients.Count - 1
If i = Recipients.Count - 1 Then
separator = ""
End If
Set Re = Recipients.item(i)
If Re.ReType = 0 Then
if ReTo<>"" then
ReTo=ReTo & ","
end if
ReTo = ReTo & Re.EMail
else
if ReCC<>"" then
ReCC=ReCC & ","
end if
ReCC = ReCC & Re.EMail
End If
Next
Set Re=Nothing
Set Recipients=Nothing
'---------------------------------

Set AT=Nothing
Set Att=Nothing
POP.Disconnect
Set POP=Nothing
End Sub
'--------隨機函數(shù)------------------
Function iRandom()
Randomize
iRandom=Session("UserID")&month(date())&day(date())&Minute(time())&Second(time)&CLng(10000 * Rnd)
end Function
'--------創(chuàng)建新文件夾--------------
Sub CreateAFolder(Path)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateFolder(Path)
Set fso=Nothing
End Sub
%>

該文章在 2010/2/1 22:56:01 編輯過
關(guān)鍵字查詢
相關(guān)文章
正在查詢...
點晴ERP是一款針對中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內(nèi)大量中小企業(yè)的青睞。
點晴PMS碼頭管理系統(tǒng)主要針對港口碼頭集裝箱與散貨日常運作、調(diào)度、堆場、車隊、財務(wù)費用、相關(guān)報表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點,圍繞調(diào)度、堆場作業(yè)而開發(fā)的。集技術(shù)的先進性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點晴WMS倉儲管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質(zhì)期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務(wù)都免費,不限功能、不限時間、不限用戶的免費OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved