Exchange Mailbox Service Broker


This broker is no longer being maintained! 

Like Outlook but in a SmartObject. Supports Office 365. This Service Broker allows K2 to connect to a specified Mailbox on Exchange and perform the following actions through SmartObjects:

  • List emails in any folder including Inbox, Drafts, Sent Items and any custom folder

  • Move emails between folders

  • Delete Emails Permanently or Move them to the Delete Items Folder

  • Read a specific email

  • Get all of the attachments on a specific email including the inline ones

  • Create Draft Emails

  • Create Reply/Forward Draft Emails

  • Attach Files to Draft Emails. You can also mark attachments as inline and use them as
    part of the body of the email

  • Send Draft Email

  • Send New Email Directly (No attachments)

  • (NEW) Supports Exchange Online / Office 365

  • (NEW) Can be configured to impersonate to access currently logged on user's mailbox

  • (NEW) Supports Shared Mailboxes.

This is very useful for when you want to develop a Mailbox Centric solution where the users typically send information/attachments to the system via email. 


This is also useful where you want to send emails to users from a specific mailbox and not the K2 Service account one. Typically, when you have many solutions on a K2 environment you might want each system to communicate with users from a different email address.


The current version  only supports the most basic features for Reading and Sending emails and some basic support for attachments. Future versions might include support for more features like Calendar Items, Meeting Requests, etc. 

30 replies

Does it support also email event, for example to start a new workflow?


Kind regards


Unfortunately not 🙂 but you could perform polling via a scheduled workflow to achieve something similar.

I'm a big +1 for potential Exchange calendar features.  This functionality would be extremely helpful with several scenarios my company has.  Thanks!

I would love to see this available for Appit. Also, I could use the calendar features right now! I'm developing a scheduling app which would greatly benefit from having a SmartObjects interface to Exchange calendars.

Hi All,


I tried to use the echange mailbox service broker. But I end up with error when executing my smartobject methods with an Unauthorized excpetion.

Could you please provide some guidelines how to use it? I mean what are the prequisite of exchange security etc.

I tried to read emails of a mailbox and create a draft mail.


Thanks and regards,


Nice! And like Justin said - would be super interested if Calendar features were added! Cheers!

Hi there.  I am wondering if you can help me with what i'm doing wrong.



When I use this object as part of a K2 studio workflow, even if I set the parameter to the shared mailbox I want to pull from, it only will pull in my own emails from MY inbox on exchange, not the shared mailbox I want it to pull from...




When I test it in the Smart Object Service Broker and use the shared email box in the parameters there, it works perfectly.  


I suspect that somehow the issue is related to authentication and permission.  I have added the K2 service account to the mailbox permissions for the shared mailbox...and am using "Service Account" as the authentication method.  Does that seem right?  






Disregard my post above.  I have that part figured out.  


I do have a suggestion on this if you're ever updating it.  


What I'm learning by doing a little Google research on Exchange is that when an e-mail moves from one folder to another, the ItemID changes.  


As I'm storing the ItemID on our application database and passing it in to view/read emails, it only is 'valid' until the email is moved...then it no longer works.


A great feature (if possible) would be to capture the NEW item id as a return property when an email is moved.  


Anyway, regardless, this is a great tool.




I see that the latest update of this application is some while ago. I would like t know if the Calendar ingegration is still under development and if there is still support on this solution. 

 There is no link to download this Service Broker, can share it please?

Userlevel 1
Badge +6

To echo previous responses, I would be interested to know if Calendar integration is available within the Service Broker.


can't read mail from a folder i created

any ideas?

Braddo - can you be more specific as to what's going on?  


You regardless of where the email resides, just passing the email ID into the read method should pull the email up. 


Did you physically move the email (as in pick it up and move it in Outlook) to the new folder?


If so, that will 'break' the connection, as Exchange changes the email ID when the email is moved.  


sure, sorry

i can read the inbox emails no problems

i would like to also read emails from another folder, 

i created a new folder within the mailbox

i manually moved an email to the folder, but i cannot read it


Exception has been thrown by the target of an invocation.

Could not list emails for the folder "Testing". Please verify that this folder is correct and that you have permission to access it.

Folder "Testing" could not be found.

Service: ExchangeMailboxService

Service Guid: 450355*personal details removed*-b7*personal details removed*ace4f5b0a82

Severity: Error




Yep.  You can't do that.  If the email moves, the emailid changes.  That's an Exchange thing.


The only way to deal with this is to do another "list emails" after the email moves to re-capture the email ID and then to an update method the database.  


It's not ideal...but it's a limitation of the broker. 

That's fine

But I can't read emails from a folder that I have created

I don't think you're getting what I'm trying to say.  This is from spending hours and hours and hours playing with this broker.


If either the broker (using the move email method) or a person (by picking up and moving an email)  moves an email from one folder to another, the emailid value changes.  Exchange doesn't simply 'move' the email, rather it makes a copy of the email, puts it into the destination folder then deletes the original email.  


You said in your previous post:


sure, sorry

i can read the inbox emails no problems

i would like to also read emails from another folder, 

i created a new folder within the mailbox

i manually moved an email to the folder, but i cannot read it



If the email was moved into the folder, K2 won't be able to read it unless you update the email ID in the database.  


It basically makes the broker worthless for email management unless you're dealing with a small enough number of emails that you can do a 'list' method against the emails in the new folder, pass in the to, from, subject and grab the email ID as the return property, then update your database record with the new email ID.  


Sorry I can't be more help.  



i understand what you are saying but here is my issue

I have a mailbox with the standard folders, Inbox , Drafts etc

I can use the 'list inbox emails; method

it returns 5 emails

i create a folder called 'Testing'

i manually move 1 message to this folder

I run the 'list inbox emails' - it returns 4 emails

i run the list folder emails, and specify Inbox - 4 emails

i run the list folder emails, and specify folder 'Testing' - fails with my error mentioned


How do i resolve this?  if i open the mailbox i can see the email in the testing folder.

i have created the service object with the user that owns the mailbox, so permissions should be fine


i hope that makes more sense



Okay.  I see where you're going...


For listing folder emails you need to have the shared mailbox field filled in, even though it's not required.  If your 'testing' folder is one level below the inbox, all you need to do is supply the name.  If it's more than one level below, you'll need to provide the hierarchy.


Here's a real working example...instead of 'testing' my folder name is k2 pulled:


For some reason the picture won't upload.


It's basically of the smart object service tester with my shared mailbox address and the folder name in the appropriate fields and a list of emails in the output window.

Here is my mailbox structure

All i see are two yellow triangles.  This platform has issues.


I sent you a PM with my regular email address.  Can you send that to me there?




i just moved a folder under the inbox itself - that now works


but how do i get it to work when the folder is at the same level as inbox?

your email address was removed :-(

Hmmm.  Not sure.  Mine are always under the inbox.  


Glad it worked out!