Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.
I need to go through emails in an Exchange mailbox (connectivity I am happy with) and extract the body text, and also save attachments if there are any.
I need to read the content of the body text, and then break it into pieces - which I can do with some .Net code - however is there a task type that allows me to read the email body without first saving the email as a file? Ideally I want to loop through each email, read the text, into Std Output for example, and pass that to another task for the actual chopping up - I can only see options to save the email as a file currently?
Forum information
Are you using mail triggers? If that's the case, you can get the body data from the trigger variable directly. No need to save anything

I have tried to add a mail trigger but can't seem to understand how to use it properly!

Where do I tell it to return the body of the email?

What context do I use it in - read one email at a time and return that to another task for processing / saving the attachments etc?

How did you get to that screen grab you attached?

I think I need to understand the basic principles / workflow I should be trying to achieve?

Thank you.
Before I go into the details: do you need to performa this action on old emails, or only for new emails going forward? Triggers are mainly for the latter. If you need to extract the message bodies on a huge amount of existing emails, triggers are probably not the best solution
Going forward it would only be for new emails hitting a mailbox.
Ok. The steps would be roughly like shown below. When setting up, chose a restrictive filter for testing. I will send mails from my gmail account as a test until I am happy with the result. It is also useful to set polling to 5-10 seconds when you are testing to avoid having to wait a lot. Once you are happy with the result, change the filter, and set the polling to something less frequent, eg 60 seconds.

1) Create a job.
2) In the triggers tab, add an event trigger of type email. In the Conditions section, add the appropriate filters. For example: 'From address' contains In the Actions tab, choose something like in the image. Note that you may not want to delete on Server! In the Save mail tab, chose to not save mails/attachments


We now have a job without any tasks, just a trigger
3) Send a testmail that passes the filter you have set. You will see that the 'Last run' columns changes if the trigger is activated.
4) Open the variables window. Find your job, choose triggers, Mail. You will find variables there with info from the last trigger.


5) Add a task that uses the email content. Pass to a .net method or whatever you want to.
Many Thanks for your help with this - would this technique still work if there were say 20 emails delivered in a couple of minutes? i.e. does it just grab the first off the top of the pile each time it polls - it will only be for new emails, but they can arrive in batches - it's essentially notifications being sent to use from a CCTV camera system which sends notifications when someone triggers some movement - as they walk through the building there can be multiple sent quite quickly.


Edit - I can see the Put Job in queue option seems to do that - it certainly seems to be running through and reading the emails - we will start it with a freshly emptied mail box.

If you multiple emails arrive at the same time, it will trigger once for each mail. So it essentially is a forEach mail loop.
Scroll to Top