bulk-mail-cli
Version:
Do quick, hassle-free email marketing with this small but very powerful tool! 🔥
23 lines • 768 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var simplesmtp = require("simplesmtp");
var checkConnection = function (options, callback) {
try {
var connection_1 = simplesmtp.connect(options.port, options.host, options);
connection_1.once('idle', function () {
connection_1.removeAllListeners();
connection_1.close();
callback(null, true);
});
connection_1.once('error', function (error) {
connection_1.removeAllListeners();
connection_1.close();
callback(error);
});
}
catch (error) {
callback('There is an error.');
}
};
exports.default = checkConnection;
//# sourceMappingURL=checkConnection.js.map