MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / mailjet

Function mailjet

compute/mailjet.js:25–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23const smtp = require('nodemailer-smtp-transport');
24
25async function mailjet() {
26 const transport = mailer.createTransport(
27 smtp({
28 host: 'in.mailjet.com',
29 port: 2525,
30 auth: {
31 user: process.env.MAILJET_API_KEY || '<your-mailjet-api-key',
32 pass: process.env.MAILJET_API_SECRET || '<your-mailjet-api-secret>',
33 },
34 })
35 );
36
37 const json = await transport.sendMail({
38 from: 'ANOTHER_EMAIL@ANOTHER_EXAMPLE.COM', // From address
39 to: 'EMAIL@EXAMPLE.COM', // To address
40 subject: 'test email from Node.js on Google Cloud Platform', // Subject
41 text: 'Hello!\n\nThis a test email from Node.js.', // Content
42 });
43 console.log(json);
44}
45mailjet();
46// [END compute_send]

Callers 1

mailjet.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected