Built motion from commit (unavailable).|2.5.26
[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 _0xa952=['use','compile','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','createTransport'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xa952,0xf8));var _0x2a95=function(_0x403d77,_0x2ff2c5){_0x403d77=_0x403d77-0x0;var _0x4e1f4b=_0xa952[_0x403d77];return _0x4e1f4b;};'use strict';var nodemailer=require(_0x2a95('0x0'));var BPromise=require(_0x2a95('0x1'));var inlineBase64=require(_0x2a95('0x2'));function EmailSmtp(){}EmailSmtp[_0x2a95('0x3')]['send']=function(_0x4a16f6,_0x4a2e1d){return new BPromise(function(_0x3ef0b7,_0x1d44e0){var _0x52967b=nodemailer[_0x2a95('0x4')](_0x4a16f6);_0x52967b[_0x2a95('0x5')](_0x2a95('0x6'),inlineBase64());_0x52967b['sendMail'](_0x4a2e1d,function(_0x1d538e,_0x1565a0){if(_0x1d538e){_0x1d44e0(_0x1d538e[_0x2a95('0x7')]());}else{_0x3ef0b7(_0x1565a0);}});});};EmailSmtp[_0x2a95('0x3')][_0x2a95('0x8')]=function(_0x46f0c2){return new BPromise(function(_0x521fb4,_0x2f0a78){var _0x36389d=nodemailer['createTransport'](_0x46f0c2);_0x36389d['verify'](function(_0xe64f6b,_0x291841){if(_0xe64f6b){_0x2f0a78(_0xe64f6b[_0x2a95('0x7')]());}else{if(_0x291841){_0x521fb4(_0x291841);}else{_0x2f0a78(_0x2a95('0x9'));}}});});};module[_0x2a95('0xa')]=EmailSmtp;