Ruby | How to Send an email from Microsoft Exchange

If you having a hard time sending an email from and MS-Exchange server, here's the easy way.

gem install viewpoint
require 'viewpoint'
include Viewpoint
endpoint = ''
username = AD_Account
password = AD_Acc_Pass
EWS::EWS.endpoint = endpoint
EWS::EWS.set_auth(username, password)
message = EWS::Message
message.send('Hi subject', 'Hola body!', [''], ['', ''])r);" (actually changes the password)

Last updated