kiwikaty Posted July 7, 2016 Posted July 7, 2016 Hi there I have an issue where it will not get all the mail from the exchange mailbox (using imap). I have tried a variety of things including deleting all the messages for that mailbox before trying to fetch (and resetting the serial) because initially if I did this it seemed to get all the mail instead of just one but now each time I only get one message regardless for this inbox/account. There are 4 emails in the inbox and I am just getting the latest one not all 4 which is my desired outcome. The issue seems to be at the line of code where it says... Exit Loop If [not EmailGetNextMessage] - as it appears to be exiting before it has been through all the messages in the xml file? I have two accounts set up and the other account is also not clearing all the messages (56 out of 170) - again I have cleared out all "message" records so it should not think that any already exist? I am not sure why it keeps exiting. I am using version 2.17 of the mail plugin and running it both on the server and on client (same result from script on both). I have tried changing the exit loop to met another condition instead but still no luck. The EmailGetMessageCount( 1 ) seems to be returning a correct number of messages but the exit loop is happening before it has created all the messages. I have attached the script. I want to get all messages in the inbox each time as during initial testing if we deleted mail from the exchange server it was not showing as deleted in filemaker - and we need what is in filemaker to reflect exactly what is in the exchange mailbox. Is it something simple that I just need to alter in the script so it does not exit until it has created all messages? Kind regards Katy fectch mail script.pdf
kiwikaty Posted July 15, 2016 Author Posted July 15, 2016 (edited) Changed the Exit Loop to be $EmaiNextMessage ≠ 1 But then I was only getting every second one as I caused my own headaches by adding... If [ (not EmailGetNextMessage) and ($count = 2) and ($messageCountCustom > 0) ] Beep End If ...when I was trying to troubleshoot and of course then it was calling the EmailGetNextMessage function twice so I was only getting every second one! Changing the Exit Loop condition and disabling the test I had added has meant I have now been able to get the full set. Happy things are working now as expected. Good lesson on being careful about adding in a test like that and the implications. Edited July 15, 2016 by kiwikaty Worked it out!
Recommended Posts
This topic is 3053 days old. Please don't post here. Open a new topic instead.
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