Giter Site home page Giter Site logo

old_node-mail's Introduction

Node.js Mail/Calendar Sample

This sample is a proof-of-concept sample that uses the Microsoft Office 365 APIs Client Libraries for Cordova Applications from a pure Node.js server app. The client libraries were designed to be run from Cordova-based client apps, so this solution might not work in all situations.

Tricks used

  • To load in the exchange.js file, which is not a Node module, I used the method described here.
  • The exchange.js file uses the AJAX XMLHttpRequest object for sending requests. To get it working quickly without having to modify exchange.js, I used the node-XMLHttpRequest module.

Required software

Running the sample

It's assumed that you have Node.js installed before starting.

  1. Download or fork the sample project.
  2. Install node-XMLHttpRequest and simple-oauth2 with npm.
  3. Download the Office 365 client libraries from Nuget. Copy exchange.js and utility.js into the .\node-modules\exchange\exchange-lib\ directory.
  4. Register the app in Azure Active Directory. The app should be registered as a web app with a Sign-on URL of "http://localhost:8000", and should be given permission to "Read users' mail" and "Read users' calendars".
  5. Edit the .\authHelper.js file. Copy the client ID for your app obtained during app registration and paste it as the value for the id variable. Copy the key you created during app registration and paste it as the value for the secret variable. Save the file.
  6. Install all required Node.js modules npm install
  7. Start the development server: npm start
  8. Use your browser to go to http://127.0.0.1:8000.
  9. You should now be prompted to connect your Office 365 account. Click the link to do so and login with an Office 365 account.
  10. You should see a table listing the existing events in your Office 365 calendar.
  11. You can view email in the inbox by browsing to http://127.0.0.1:8000/mail.

Copyright

Copyright (c) Microsoft. All rights reserved.


Connect with me on Twitter @JasonJohMSFT

Follow the Exchange Dev Blog

old_node-mail's People

Contributors

jasonjoh avatar pacarole avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.