1
我試圖讓使用cfimap
這樣最新的郵件:獲取使用CFIMAP最新郵件的ColdFusion
<cfset local.objIMAP = structNew()>
<cfset local.objIMAP.server = "imap.gmail.com">
<cfset local.objIMAP.username = "username">
<cfset local.objIMAP.password = "password">
<!--- Open the connection --->
<cfimap
action="open"
secure="yes"
connection="myConnection"
attributeCollection="#local.objIMAP#">
<cfimap
action="getHeaderOnly"
connection="myConnection"
name="getHeaders">
<!--- Get the messagenumber of latest mail --->
<cfquery dbtype="query" name="getID">
SELECT MAX(getHeaders.messagenumber) AS latestMessage
FROM getHeaders
</cfquery>
<cfimap
action="getall"
connection="myConnection"
name="getAttachment"
attachmentpath="E:/"
MessageNumber="#getID.latestMessage#">
我得到超時的情況下郵件的數量較多。
那麼有沒有其他的方式來獲取最新的郵件?
或使用java
我們可以在較短的時間內獲得最新郵件的UID
或messageNumber
嗎?
請幫忙。提前致謝。隨着工作的完成消息ID後
<cfimap action="MarkRead" connection = "Conn" messagenumber="#getHeaders.messagenumber#">
:
我不認爲它們標記閱讀是要解決問題。如果有更多的郵件,獲得'headers'或'all'的時間會更多。 – Beginner 2015-04-11 17:31:15
將它們標記爲已讀並移至其他文件夾 –
shemy
2015-04-13 09:50:23