Mobile Line Of Business

Richard Jones (MVP)

  Home  |   Contact  |   Syndication    |   Login
  202 Posts | 0 Stories | 36 Comments | 0 Trackbacks


Welcome to the Mobile Line Of Business Blog

Tag Cloud


Post Categories


You know that instance, where you're sitting at home and that vital set of airline tickets or shopping list arrives to you by email, which you pickup on your mobile device (Windows Mobile, iPhone, Android, etc).


Of course for things like flight tickets its no good taking your phone to the check in desk and waving it in front of the nice person at the check in desk.  (Although I guess that might work).  Before you say anything, yes I do no about check in online,  but stick with it.

What I'm trying to get at, is an easy way from your mobile device of being able to get a hard copy of an email, without powering up a desktop/laptop machine getting at the same email you have just read and printing.

So in an ideal world,  you would just forward the email to a print email address (i.e,  maybe put a PIN in the subject line, or instructions whether I wanted to include attachments etc. and magically the printer would print out the mail.

So foolishly, (it appears now).   I thought how hard can this be?   I setup a user on my server with an email address.   I'm running Small Business Server, With Exchange 2003, so this was a snap. I tried several strategies to try and get this working:

Experiment 1 - Use WebDav, CDO and ADODB.  Technologies which have been around for a while and are used to pro grammatically get at Exchange.   This is all however a bit of a black art.     With Exchange 2007,   these technologies are being replaced with Exchange Web Access,  which is a web-service wrapper to Exchange,   however I'm Exchange 2003 so I was forced to try the old school technique.

I could bore you with all the code (mail me if you want it).    The closest I could get this to working,  was to list all unread messages in the appropriate Exchange mailbox and list out the DAV URL's  i,e


OK great,   now what.   How can I go from that to produce nice printed output.    Using the Web Browser control I could then open the email,  but although I didn't try to hard,  I couldn't make the email print nicely formatted.   This experiment ended with everything just falling into the too difficult category.    I stumbled around trying to also get the emails to delete once read but gave up in frustration.

Experiment 2 - Use the .Net office integration provided by Office in the name of the assembly Microsoft.Office.Interop.Outlook.    This worked brilliantly.   I could enumerate all message in an Inbox,  see just the unread ones, delete  and finally print.   The print was slightly restricted as its just a simple PrintOut() method that doesn't give you much control of the printed output.    Again if you want source just mail me.

However,   things got tricky when you analysed how you would use this solution.   I wanted things to run as a service on my server,  sitting in the background just waiting for those vital airline ticket emails to be forwarded.    So apart from not having Outlook installed on the server (for obvious reasons),  you also have to use an Outlook profile,   which for an application running as a service seemed a little messy to configure.

Now I know I could use other options like POP-ing email from Exchange etc and that would be much simpler,  but I was really trying to achieve this with the Exchange infrastructure I have in place.

So in conclusion, I have a workable solution just one that I'm not happy with.     Anyone got any other ideas?

posted on Saturday, January 3, 2009 8:26 PM