Hope everyone is fine and doing good. In this article of mine, I am going to narrate, how you can fetch Emails from your Microsoft Outlook account. I am only going to cover ‘Inbox‘ here. However, the scope of library (Gem) is very vast and you can customize this as per your need.
- ViewPoint Gem:
gem install viewpoint
For Debugging, I am using viewpoint/logging/config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|require 'viewpoint' # Library for MS Outlook|
|require 'viewpoint/logging/config' # For Debugging|
|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|
|inbox = cli.get_folder_by_name 'Inbox'|
|items = inbox.items|
Hope this helps someone! Keep in touch and Happy Coding 🙂