Iversen Posted September 17, 2015 Share Posted September 17, 2015 Hi,we are using Synology NAS with Zaraf Mail Server.User mail address look like john.doe@domain.com und this is the default sender address for the user.The user have the right to send as info@domain.com and can switch to this address in Outlook. If the user send with info@domain.com the sent mails stored in the "Sent Items" folder of the user. We habe a public Folder in which all mails send as info@domain.com must stored. Outlook own rules dont work. Most of this rules are not supporttet by Zarafa.Now i want to create an autoit script which move mails send as info@domain.com to a spezial folder.Here my Idea with Unread mails. In dont know what to change to work with mails "send as" ; Include Functions #include <OutlookEX.au3> ; Connect to Outlook Global $oOutlook = _OL_Open() If @error <> 0 Then Exit MsgBox(16, "Connect to Outlook", "Error connecting to Outlook. @error = " & @error & ", @extended = " & @extended) ; Access correct mailbox Global $aFolder = _OL_FolderAccess($oOutlook, "john.doe@domain.com\Posteingang\Test", $olFolderInbox) If @error <> 0 Then Exit MsgBox(16, "Folder access", "Error accessing the mailbox. @error = " & @error & ", @extended = " & @extended) ; Get unread items Global $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "[Unread]=True", "", "", "EntryID,Subject,Body") If @error <> 0 Then Exit MsgBox(16, "Item find", "Error searching for unread mail items. @error = " & @error & ", @extended = " & @extended) ; If IsArray($aItems) Then _ArrayDisplay($aItems) MsgBox(0, "Number of unread items", $aItems[0][0]) If $aItems[0][0] = 0 Then Exit MsgBox(16, "Error", "No mail items in Correct Mailbox Inbox.") ; _OL_ItemDisplay($oOutlook, $aItems[1][0]) _OL_ItemMove($oOutlook, $aItems[1][0], Default, "john.doe@domain.com\Posteingang\testneu") _OL_Close($oOutlook)thx 4 your help Link to comment Share on other sites More sharing options...
water Posted September 17, 2015 Share Posted September 17, 2015 Check property SentOnBehalfOfName. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Iversen Posted September 18, 2015 Author Share Posted September 18, 2015 Check property SentOnBehalfOfName. so i can use SentOnBehalfOfName like Global $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, "SentOnBehalfOfName=Info", "", "", "EntryID,Subject,Body")?i have no outlook on this PC to test it. I can test it next week at work. thx Link to comment Share on other sites More sharing options...
water Posted September 18, 2015 Share Posted September 18, 2015 Should beGlobal $aItems = _OL_ItemFind($oOutlook, $aFolder[1], $olMail, '[SentOnBehalfOfName] = "Info"', "", "", "EntryID,Subject,Body")but at the moment I can't test either. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now