1
0
Fork 0
mirror of synced 2024-09-15 08:47:37 +12:00

Merge pull request #14037 from Budibase/chore/verify-ethereal

Script to verify ethereal
This commit is contained in:
Martin McKeaveney 2024-07-15 16:30:49 +01:00 committed by GitHub
commit 5b62ea529a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,31 @@
const nodemailer = require("nodemailer")
const options = {
port: 587,
host: "smtp.ethereal.email",
secure: false,
auth: {
user: "seamus99@ethereal.email",
pass: "5ghVteZAqj6jkKJF9R",
},
}
const transporter = nodemailer.createTransport(options)
transporter.verify(function (error) {
if (error) {
console.log(error)
} else {
console.log("Ethereal server is ready to take our messages")
}
})
const message = {
from: "from@example.com",
to: "to@example.com",
subject: "Did this email arrive?",
html: "Hello World!",
}
transporter.sendMail(message).then(response => {
console.log("Test email URL: " + nodemailer.getTestMessageUrl(response))
})