Email-object describing the email to send
Returns a promise which can either fail (string with reason) or succeed (string with status)
When the API has not been properly configured using configure, an exception is thrown detailing the missing information.
import { api } from "@hboictcloud/api";
try {
const data = await api.sendEmail({
from: {
name: "Group",
address: "group@fys.cloud"
},
to: [
{
name: "Lennard Fonteijn",
address: "l.c.j.fonteijn@hva.nl"
}
],
subject: "Just a test!",
html: "<h1>Hello Lennard!</h1><p>This is an email :)</p>"
});
console.log(data);
}
catch(reason) {
console.log(reason);
}
Send an email