Skip to content

Instantly share code, notes, and snippets.

@puneetpandey
Created April 28, 2015 07:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save puneetpandey/26035213128e5bc535dc to your computer and use it in GitHub Desktop.
Save puneetpandey/26035213128e5bc535dc to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'viewpoint' # Library for MS Outlook
require 'viewpoint/logging/config' # For Debugging
include Viewpoint::EWS
endpoint = 'YOUR MS EXACHANGE URL COMES HERE' # E.g. https://OUTLOOKSERVER_URL/ews/exchange.asmx
user = 'USERNAME'
pass = 'PASSWORD'
cli = Viewpoint::EWSClient.new endpoint, user, pass
folders = cli.folders
p folders[0].inspect
inbox = cli.get_folder_by_name 'Inbox'
items = inbox.items
p items[0].body.inspect
p items.count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment