18296412fc8f535ac3348d4e920465b37f2ba677
[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 _0x3740=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x4e0159,_0x528421){var _0x2e0d6d=function(_0x495e9e){while(--_0x495e9e){_0x4e0159['push'](_0x4e0159['shift']());}};_0x2e0d6d(++_0x528421);}(_0x3740,0x181));var _0x0374=function(_0x317497,_0x2d6cf7){_0x317497=_0x317497-0x0;var _0x3445b0=_0x3740[_0x317497];return _0x3445b0;};'use strict';var nodemailer=require(_0x0374('0x0'));var inlineBase64=require(_0x0374('0x1'));function EmailSmtp(){}EmailSmtp[_0x0374('0x2')][_0x0374('0x3')]=function(_0x327c3a,_0x1e8252){return new Promise(function(_0x3c89a7,_0x294f12){var _0x3614f8=nodemailer[_0x0374('0x4')](_0x327c3a);_0x3614f8[_0x0374('0x5')](_0x0374('0x6'),inlineBase64());_0x3614f8[_0x0374('0x7')](_0x1e8252,function(_0x520cf7,_0x3ee9f7){if(_0x520cf7){_0x294f12(_0x520cf7[_0x0374('0x8')]());}else{_0x3c89a7(_0x3ee9f7);}});});};EmailSmtp[_0x0374('0x2')]['verify']=function(_0x214541){return new Promise(function(_0xe0f475,_0x5032a2){var _0x30c42c=nodemailer['createTransport'](_0x214541);_0x30c42c[_0x0374('0x9')](function(_0x1a9952,_0x42a0c8){if(_0x1a9952){_0x5032a2(_0x1a9952[_0x0374('0x8')]());}else{if(_0x42a0c8){_0xe0f475(_0x42a0c8);}else{_0x5032a2(_0x0374('0xa'));}}});});};module[_0x0374('0xb')]=EmailSmtp;