Built motion from commit f3da74b7.|2.5.36
[motion2.git] / server / services / email / lib / smtp.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xf0bb=['use','compile','sendMail','verify','toString','bluebird','prototype','send','createTransport'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xf0bb,0xcb));var _0xbf0b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf0bb[_0x4b369d];return _0x571a98;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0xbf0b('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xbf0b('0x1')][_0xbf0b('0x2')]=function(_0x284d2d,_0x229241){return new BPromise(function(_0x390820,_0x3b6fee){var _0x2acf15=nodemailer[_0xbf0b('0x3')](_0x284d2d);_0x2acf15[_0xbf0b('0x4')](_0xbf0b('0x5'),inlineBase64());_0x2acf15[_0xbf0b('0x6')](_0x229241,function(_0x2033f6,_0x221815){if(_0x2033f6){_0x3b6fee(_0x2033f6['toString']());}else{_0x390820(_0x221815);}});});};EmailSmtp['prototype'][_0xbf0b('0x7')]=function(_0x22b0f7){return new BPromise(function(_0x5a233f,_0x5afdb2){var _0x1f0296=nodemailer['createTransport'](_0x22b0f7);_0x1f0296[_0xbf0b('0x7')](function(_0x3ceac3,_0x436b44){if(_0x3ceac3){_0x5afdb2(_0x3ceac3[_0xbf0b('0x8')]());}else{if(_0x436b44){_0x5a233f(_0x436b44);}else{_0x5afdb2('Not\x20verifired');}}});});};module['exports']=EmailSmtp;