Created
          September 24, 2013 19:33 
        
      - 
      
- 
        Save willread/6690078 to your computer and use it in GitHub Desktop. 
    Send email with nodemailer
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var nodemailer = require("nodemailer"); | |
| var transport = nodemailer.createTransport("SMTP", { | |
| service: "Gmail", | |
| auth: { | |
| user: "[email protected]", | |
| pass: "******" | |
| } | |
| }); | |
| var options = { | |
| from: "Full Name <[email protected]>", | |
| to: "[email protected]", | |
| subject: "Subject", | |
| text: "", | |
| html: "" | |
| }; | |
| transport.sendMail(options, function(error, response){ | |
| if(error){ | |
| console.log(error); | |
| }else{ | |
| console.log("Sent: " + response.message); | |
| } | |
| transport.close(); | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment