Built motion from commit da617fac.|2.6.6
[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 _0x31fe=['compile','toString','verify','Not\x20verifired','nodemailer','prototype','send','createTransport'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x31fe,0x64));var _0xe31f=function(_0x1a511a,_0xdf348f){_0x1a511a=_0x1a511a-0x0;var _0xba4cd0=_0x31fe[_0x1a511a];return _0xba4cd0;};'use strict';var nodemailer=require(_0xe31f('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xe31f('0x1')][_0xe31f('0x2')]=function(_0x2b7318,_0xf84427){return new Promise(function(_0xab2422,_0x19a5b7){var _0x2a0735=nodemailer[_0xe31f('0x3')](_0x2b7318);_0x2a0735['use'](_0xe31f('0x4'),inlineBase64());_0x2a0735['sendMail'](_0xf84427,function(_0x521a8a,_0x36395b){if(_0x521a8a){_0x19a5b7(_0x521a8a[_0xe31f('0x5')]());}else{_0xab2422(_0x36395b);}});});};EmailSmtp[_0xe31f('0x1')][_0xe31f('0x6')]=function(_0x20bca7){return new Promise(function(_0x2acd6f,_0x495e0b){var _0x57c2dc=nodemailer['createTransport'](_0x20bca7);_0x57c2dc[_0xe31f('0x6')](function(_0x4a039a,_0x923cab){if(_0x4a039a){_0x495e0b(_0x4a039a[_0xe31f('0x5')]());}else{if(_0x923cab){_0x2acd6f(_0x923cab);}else{_0x495e0b(_0xe31f('0x7'));}}});});};module['exports']=EmailSmtp;