Investigamos en todo el mundo on line y así traerte la respuesta para tu inquietud, en caso de preguntas puedes dejar tu inquietud y te contestaremos porque estamos para ayudarte.
Ejemplo 1: node js sendgrid
const sgMail =require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);const msg =
to:'[email protected]',from:'[email protected]',
subject:'Sending with SendGrid is Fun',
text:'and easy to do anywhere, even with Node.js',;
sgMail.send(msg).catch(err=>console.log(err););
Ejemplo 2: node js sendgrid
const sgMail =require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);const fs =require("fs");
pathToAttachment =`$__dirname/attachment.pdf`;
attachment = fs.readFileSync(pathToAttachment).toString("base64");const msg =
to:[email protected].com',from:'[email protected]',
subject:'Sending with SendGrid is Fun',
text:'and easy to do anywhere, even with Node.js',;
sgMail.send(msg).catch(err=>console.log(err););
Ejemplo 3: node js sendgrid
npm install @sendgrid/mail
Ejemplo 4: node js sendgrid
const sgMail =require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);const fs =require("fs");
pathToAttachment =`$__dirname/attachment.pdf`;
attachment = fs.readFileSync(pathToAttachment).toString("base64");const msg =
to:[email protected].com',from:'[email protected]',
subject:'Sending with SendGrid is Fun',
text:'and easy to do anywhere, even with Node.js',
attachments:[
content: attachment,
filename:"attachment.pdf",
type:"application/pdf",
disposition:"attachment"];
sgMail.send(msg).catch(err=>console.log(err););
Si te ha sido de provecho este post, sería de mucha ayuda si lo compartes con más entusiastas de la programación y nos ayudes a difundir nuestra información.
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)