Thanks for your replies. I solved this.
Actually the exception is because, The outlook contains not only mail items but also calender items,meeting items etc,. hence it is throwing exception when we are trying to access other item as mailItem.
click here for solution