I can't find any helpful posts specific to sending emails from dreamhost using nodemailer. I did find a dreamhost article for sending emails via PHP so maybe that can help point us in the right direction...
Either way here's my mailer.ts
file:
import { createTransport, getTestMessageUrl } from "nodemailer";
import { frontendURL } from "./urls";
var transport = createTransport({
host: "smtp.dreamhost.com",
port: 465,
auth: {
user: encodeURIComponent(process.env.PROD_MAIL_USER),
pass: encodeURIComponent(process.env.PROD_MAIL_PASS),
},
secure: true,
});
function generateHTML(resetToken: string) {
return `
<div>
<h2>Hello from HaBits