-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample2.js
More file actions
executable file
·28 lines (22 loc) · 863 Bytes
/
Copy pathexample2.js
File metadata and controls
executable file
·28 lines (22 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const {MailerSend, Recipient, EmailParams } = require("mailersend"); // Asegúrate de usar .default
require('dotenv').config();
const mailersend = new MailerSend({
apiKey: process.env.AppUtos_API_KEY,
});
const recipients = [new Recipient("desarrollospeed03@gmail.com")];
const emailParams = new EmailParams()
.setFrom("mkoromini94@gmail.com")
.setFromName("MK")
.setRecipients(recipients)
.setSubject("Subject")
.setHtml("Greetings from the team, you got this message through MailerSend.")
.setText("Greetings from the team, you got this message through MailerSend.");
const sendEmail = async () => {
try {
const response = await mailersend.send(emailParams);
console.log('Email sent successfully:', response);
} catch (error) {
console.error('Error sending email:', error);
}
};
sendEmail();