add smtpInstance in emailManager

This commit is contained in:
grimhilt
2023-04-09 23:46:33 +02:00
parent 160bb0c605
commit 4b21168547
5 changed files with 51 additions and 43 deletions

View File

@@ -1,12 +1,10 @@
import { Account } from "../imap/ImapSync";
import logger from "../../system/Logger";
import nodemailer, { Transporter } from "nodemailer";
export class SmapInstance {
export class SmtpInstance {
transporter: Transporter;
account: Account;
constructor(account) {
constructor(account: {user: string, password: string}) {
// todo store other data
this.transporter = nodemailer.createTransport({
host: "smtp.gmail.com",
@@ -17,7 +15,6 @@ export class SmapInstance {
pass: account.password,
},
});
this.account = account;
}
sendMail() {