chyvak-package 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/m0603.js +28 -0
 - package/package.json +15 -0
 
    
        package/m0603.js
    ADDED
    
    | 
         @@ -0,0 +1,28 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            const nodeMailer = require("nodemailer");
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module.exports.send = function (from, pass, message) {
         
     | 
| 
      
 4 
     | 
    
         
            +
              let transporter = nodeMailer.createTransport({
         
     | 
| 
      
 5 
     | 
    
         
            +
                host: 'smtp.mail.ru',
         
     | 
| 
      
 6 
     | 
    
         
            +
                port: 465,
         
     | 
| 
      
 7 
     | 
    
         
            +
                secure: true,
         
     | 
| 
      
 8 
     | 
    
         
            +
                auth: {
         
     | 
| 
      
 9 
     | 
    
         
            +
                  user: from,
         
     | 
| 
      
 10 
     | 
    
         
            +
                  pass: pass
         
     | 
| 
      
 11 
     | 
    
         
            +
                }
         
     | 
| 
      
 12 
     | 
    
         
            +
              });
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
              const mailOptions = {
         
     | 
| 
      
 15 
     | 
    
         
            +
                from: from,
         
     | 
| 
      
 16 
     | 
    
         
            +
                to: message.to,
         
     | 
| 
      
 17 
     | 
    
         
            +
                subject: 'Sending Email using Node.js',
         
     | 
| 
      
 18 
     | 
    
         
            +
                text: message.text
         
     | 
| 
      
 19 
     | 
    
         
            +
              };
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              transporter.sendMail(mailOptions, (error, info) => {
         
     | 
| 
      
 22 
     | 
    
         
            +
                if (error) {
         
     | 
| 
      
 23 
     | 
    
         
            +
                  return console.log(error);
         
     | 
| 
      
 24 
     | 
    
         
            +
                }
         
     | 
| 
      
 25 
     | 
    
         
            +
                console.log('Message %s sent: %s', info.messageId, info.response);
         
     | 
| 
      
 26 
     | 
    
         
            +
              });
         
     | 
| 
      
 27 
     | 
    
         
            +
            }
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
    
        package/package.json
    ADDED
    
    | 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            {
         
     | 
| 
      
 2 
     | 
    
         
            +
              "name": "chyvak-package",
         
     | 
| 
      
 3 
     | 
    
         
            +
              "version": "1.0.0",
         
     | 
| 
      
 4 
     | 
    
         
            +
              "description": "my package",
         
     | 
| 
      
 5 
     | 
    
         
            +
              "main": "m0603.js",
         
     | 
| 
      
 6 
     | 
    
         
            +
              "dependencies": {
         
     | 
| 
      
 7 
     | 
    
         
            +
                "nodemailer": "^6.9.1"
         
     | 
| 
      
 8 
     | 
    
         
            +
              },
         
     | 
| 
      
 9 
     | 
    
         
            +
              "devDependencies": {},
         
     | 
| 
      
 10 
     | 
    
         
            +
              "scripts": {
         
     | 
| 
      
 11 
     | 
    
         
            +
                "test": "echo \"Error: no test specified\" && exit 1"
         
     | 
| 
      
 12 
     | 
    
         
            +
              },
         
     | 
| 
      
 13 
     | 
    
         
            +
              "author": "pol",
         
     | 
| 
      
 14 
     | 
    
         
            +
              "license": "ISC"
         
     | 
| 
      
 15 
     | 
    
         
            +
            }
         
     |