gpt4 book ai didi

coldfusion - CFIMAP 从所有文件夹中读取电子邮件

转载 作者:行者123 更新时间:2023-12-03 16:28:22 24 4
gpt4 key购买 nike

我每天都使用 CFIMAP 下载电子邮件附件。尽管到目前为止我已经尝试过,但脚本正在从我的所有文件夹中读取电子邮件,而不是仅从收件箱中读取。有人知道如何解决这个问题吗?

这是我的代码:

    <cfimap 
server = "mail.example.com"
username = "user@sexample.com"
action="open"
secure="yes"
password = "pass"
connection = "mail.example.com" >

<cfimap
action="GetAll"
folder="Inbox"
name="test"
attachmentpath="e:\testfolder"
GenerateUniqueFilenames="yes"
connection="mail.example.com" >

<cfimap
action="MoveMail"
newfolder="processedEmails"
stoponerror="true"
connection="mail.example.com">

<cfimap action="close" connection = "mail.example.com">

最佳答案

你可以试试下面的代码..

<cfimap action="open" connection="Conn" server="serverurl" username="useremail"      password="passwrd" secure="yes" port="">
<cfimap action="getall" connection="Conn" name="getAttachments" folder="Inbox" attachmentpath="#GetTempDirectory()#" >

<cfquery dbtype="query" name="getMailAttachments">
select *
from getAttachments
where seen=<cfqueryparam value="no" cfsqltype="cf_sql_varchar">
and ATTACHMENTS is not null
</cfquery>
<cfloop query="getMailAttachments">
<cfimap action="MarkRead" connection = "Conn" uid="#getMailAttachments.UID#">
<cfimap action="movemail" connection = "Conn" newfolder="Read mails" uid="#getMailAttachments.UID#">
</cfloop>

关于coldfusion - CFIMAP 从所有文件夹中读取电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15124339/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com