router.get('/', async (ctx) => { ctx.set('Cache-Control', 'public'); await ctx.render('index', { pretty: config.app.prettyHtml, title: config.app.title, defaultAddress: name.randomAdjective().toLowerCase() + '-' + name.randomNoun() + '@' + config.mail.domains[Math.floor(Math.random() * config.mail.domains.length)], domains: config.mail.domains }); });
test(ctx) { const connection = new SMTPConnection({ host: config.app.smtp.host, port: config.app.smtp.port, name: config.mail.hostname, secure: false, from: config.app.test.fromAddress + '@' + config.mail.domains[0], to: ctx.email }; from: '"' + config.app.test.fromName + '" <' + envelope.from + '>', to: envelope.to, subject: config.app.test.subject, text: config.app.test.message });