Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var request = require('request');
- const nodemailer = require('nodemailer');
- request('https://temp-mail.org/fr/', function (error, response, body) {
- if (!error && response.statusCode == 200) {
- // Show the HTML for the Google homepage.
- var body = body.replace(/ /gm, '')
- var index = body.indexOf('value')
- body = body.substr(index)
- index = body.indexOf('"')
- body = body.substr(index+1)
- index = body.indexOf('"')
- destinataire = body.substr(0, index)
- console.log(body)
- let transporter = nodemailer.createTransport({
- service: 'gmail',
- auth: {
- user: 'crannser69@gmail.com',
- pass: 'marcrosspolpol'
- }
- });
- // setup email data with unicode symbols
- let mailOptions = {
- from: 'hello worl', // sender address
- to: destinataire, // list of receivers
- subject: 'hello ', // Subject line
- text: 'hello world ?', // plain text body
- html: '<b>hello world ?</b>' // html body
- };
- // send mail with defined transport object
- transporter.sendMail(mailOptions, (error, info) => {
- if (error) {
- return console.log(error);
- }
- console.log('Message %s sent: %s', info.messageId, info.response);
- request('https://temp-mail.org/fr/', function (error, response, mailBody) {
- if (!error && response.statusCode == 200) {
- var baseBody = mailBody;
- // Show the HTML for the Google homepage.
- var mailBody = mailBody.replace(/ /gm, '')
- index = mailBody.indexOf('value')
- mailBody = mailBody.substr(index)
- index = mailBody.indexOf('"')
- mailBody = mailBody.substr(index+1)
- index = mailBody.indexOf('"')
- mailBody = mailBody.substr(0, index)
- console.log(mailBody)
- console.log('finie')
- var baseBody = baseBody.replace(/ /gm, '')
- index = baseBody.indexOf('hello')
- baseBody = baseBody.substr(index)
- index = baseBody.indexOf('world')
- baseBody = baseBody.substr(0, index)
- console.log(baseBody)
- }
- });
- });
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement