Created
February 17, 2025 22:57
-
-
Save delorenj/181aeaf2fe5a3674850e244f821f8fb6 to your computer and use it in GitHub Desktop.
This script generates an Ethereal email account, logs in the email address and password to the console, and then exits. The email and password are needed for local development, as they are used as the "from" email address for all emails sent from the server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nodemailer from 'nodemailer'; | |
async function generateEtherealAccount() { | |
const testAccount = await nodemailer.createTestAccount(); | |
console.log('Ethereal Email credentials:'); | |
console.log('ETHEREAL_USER=' + testAccount.user); | |
console.log('ETHEREAL_PASSWORD=' + testAccount.pass); | |
} | |
generateEtherealAccount(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment