daily pastebin goal
23%
SHARE
TWEET

Nodemailer

a guest Dec 23rd, 2017 444 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // nodemailer modul laden
  2. const nodemailer = require('nodemailer');
  3.  
  4. // E-Mail Sender SMTP Zugangsdaten hier eintragen
  5. var config = {
  6.     host: 'mail.cloud13.de',
  7.     port: 443,
  8.     secure: false, // use TLS
  9.     auth: {
  10.         user: 'accelerator@cloud13.de',
  11.         pass: 'ksystem15'
  12.     }/*,
  13.     tls: {
  14.         // do not fail on invalid certs
  15.         rejectUnauthorized: false
  16.     }*/
  17. };
  18.  
  19. // optional: verbindung testen
  20. /*
  21. transporter.verify(function(error, success) {
  22.     if (error) {
  23.          console.log(error);
  24.     } else {
  25.          console.log('Server is ready to take our messages');
  26.     }
  27. });
  28. */
  29.  
  30.  
  31. // erstelle transporter
  32. let transporter = nodemailer.createTransport(config);
  33.  
  34.  
  35. // erstelle nachricht
  36. var message = {
  37.     from: 'accelerator@cloud13.de',
  38.     to: 'accelerator.chatbot@web.de',
  39.     subject: 'Message title',
  40.     text: 'Plaintext version of the message'
  41.     //html: '<p>HTML version of the message</p>'
  42. };
  43.  
  44.  
  45. // email senden
  46. transporter.sendMail(message, function(err){
  47.     if(err){
  48.         console.log("fehler:", err);
  49.     } else {
  50.         console.log("nachricht versendet");
  51.     }
  52. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top