UPDATE: We just posted a blog on a new and better way to do this! Check out the blog post at http://blogs.msdn.com/b/exchangedev/archive/2015/01/22/building-demon-or-service-apps-with-office-365-mail-calendar-and-contacts-apis-oauth2-client-credential-flow.aspx and use that method going forward. One of the things you frequently want to do in your custom applications is send out emails. Historically this could be solved by using an SMTP server…