Skip to content

Instantly share code, notes, and snippets.

@delorenj
Created February 17, 2025 22:57
Show Gist options
  • Save delorenj/181aeaf2fe5a3674850e244f821f8fb6 to your computer and use it in GitHub Desktop.
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.
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