//import * as nodemailer from "nodemailer"; //const nodemailer = require('lib/nodemailer'); //const nodemailer = require('node_modules/nodemailer/lib/nodemailer'); const nodemailer = require('nodemailer'); // Erstelle den Transporter const transporter = nodemailer.createTransport({ //host: "localhost", // MailHog läuft standardmäßig auf localhost host: "mailhog.mailhog.svc.cluster.local", //"10.96.177.226", // MailHog ClusterIP port: 1025, // Standard-MailHog SMTP-Port secure: false // MailHog benötigt keine Verschlüsselung }); // E-Mail senden async function sendEmail() { try { const info = await transporter.sendMail({ from: '"Test Sender" ', to: "Christopher.Hase@telekom.com;test@mailhog.local", subject: "Hallo von MailHog", text: "Das ist eine Test-E-Mail mit MailHog und TypeScript.", html: "

Das ist eine Test-E-Mail mit MailHog und TypeScript.

" }); console.log("E-Mail gesendet: ", info.messageId); } catch (error) { console.error("Fehler beim Senden der E-Mail:", error); } } sendEmail();