16efd2e5870c428bb53b72573cf5b6a337709013
[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 _0x4cbf=['Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString'];(function(_0x5d0901,_0x110cc2){var _0xf961f0=function(_0x5c8bf9){while(--_0x5c8bf9){_0x5d0901['push'](_0x5d0901['shift']());}};_0xf961f0(++_0x110cc2);}(_0x4cbf,0x187));var _0xf4cb=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4cbf[_0x2b4411];return _0x8e41ef;};'use strict';var nodemailer=require(_0xf4cb('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xf4cb('0x1'));function EmailSmtp(){}EmailSmtp[_0xf4cb('0x2')][_0xf4cb('0x3')]=function(_0x16f2be,_0x4c71fc){return new BPromise(function(_0x1c3343,_0x157efc){var _0x4fa392=nodemailer[_0xf4cb('0x4')](_0x16f2be);_0x4fa392[_0xf4cb('0x5')](_0xf4cb('0x6'),inlineBase64());_0x4fa392[_0xf4cb('0x7')](_0x4c71fc,function(_0x3222c0,_0x44be94){if(_0x3222c0){_0x157efc(_0x3222c0[_0xf4cb('0x8')]());}else{_0x1c3343(_0x44be94);}});});};EmailSmtp[_0xf4cb('0x2')]['verify']=function(_0x56ce4b){return new BPromise(function(_0x47b841,_0x11c0f9){var _0x36b9dd=nodemailer[_0xf4cb('0x4')](_0x56ce4b);_0x36b9dd['verify'](function(_0x56d343,_0x421e70){if(_0x56d343){_0x11c0f9(_0x56d343[_0xf4cb('0x8')]());}else{if(_0x421e70){_0x47b841(_0x421e70);}else{_0x11c0f9(_0xf4cb('0x9'));}}});});};module['exports']=EmailSmtp;