Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a href="/admin/enviar">enviar correo</a>
- var transporter = nodemailer.createTransport({
- service: 'gmail',
- auth: {
- user: 'danielroca7derc@gmail.com',
- pass: '*********'
- }
- });
- router.get('/enviar', function (req, res, next) {
- console.log("voy a enviar un correo");
- var mailOptions = {
- from: '"ColSport ?" <danielroca7derc@gmail.com>', // sender address
- to: 'danielroca_7@hotmail.com, danielroca7derc@gmail.com', // list of receivers
- subject: 'Hello ✔', // Subject line
- text: 'Hello world ?', // plaintext body
- html: '<b>Hello world ?</b>' // html body
- };
- transporter.sendMail(mailOptions, function(error, info) {
- if (error) {
- return console.log(error);
- }
- console.log('Message %s sent: %s', info.messageId, info.response);
- });
- res.redirect('back');
- })
Add Comment
Please, Sign In to add comment