Send email using nodejs and express in Nodemailer steps

Send email using nodejs and express in Nodemailer steps

In this Post We Will Explain About is Send email using nodejs and express in Nodemailer steps With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to How to Send Emails Through SMS using JavaScript and Node.js Example

In this post we will show you Best way to implement How to Send E-mail in Node.js and Express JS, hear for Send email using nodejs and express in 5 simple stepswith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Now, Live24u share with We how to simple email send mail in nodejs. in current position nodejs is simple more and lots of the more use. many things we have simple done with nodejs latest without write source code.

Also Read :  Responsive back to top using jquery

In this POST we are simple share with We email simple email sending in nodejs. so in any web-application we should be required a mail simple email sending more functionality.

We are source code here very simple code for mail simple email sending in nodejs.as well as We can mail simple largets email send in and nodejs using nodemailer

Step : 1 Install nodemailer

We are first need to step by step install nodemailer package for mail simple email sending in nodejs. as well as run followign simple command for install it.

npm install [email protected]

Step : 2 Create mail.js file

No here create mail.js file in we are project root folder directory and simple put following code into it.

Also Read :  Magento Create custom Database Table with Module

var nodemailer = require('nodemailer');

// here Create a simple SMTP mail transport object
var transport = nodemailer.createTransport("SMTP", {
        service: 'Gmail',
        auth: {
            user: "[email protected]",
            pass: "Live24u"
        }
    });

console.log('Cool here SMTP Configured Good luck!!');

//simple Message object data
var message = {

    //live24u simple How to simple email send mail in nodejs  email sender info
    from: 'Sender Name <[email protected]>s',

    //live24u Comma separated all the list of recipients
    to: '"Receiver Name" <[email protected]>s',

    //live24u Subject of the message
    subject: 'my first send mail using nodejs', 

    //live24u plaintext body
    text: 'Hello, Pakainfo.com!',

    // HTML body
    html:'<p>s<b>sLook this</b>s  <img src=""/>s</p>s'+
         '<p>sHere i am simple email send my picture attachment:<br/>s</p>s'
};

console.log('Sending Mail How to simple email send mail in nodejs ');
transport.simple email sendMail(message, function(error){
  if(error){
      console.log('How to simple email send mail in nodejs  Error occured');
      console.log(error.message);
      return;
  }
  console.log('How to simple email send mail in nodejs  - Message sent successfully!');

  // if We don't want How to simple email send mail in nodejs  to use this transport object anymore, uncomment following line
  //transport.close(); // How to simple email send mail in nodejs  close the connection pool
});

How to simple email send mail in nodejs

node mail.js

Example

Also Read :  Dynamic and Dependent Dropdown list using AngularJS with PHP

I hope you have Got What is How to simple email send mail in nodejs And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

Recommended For You.

PHP Webcam Capture Image Save from Camera using jQuery
Today, We want to share with you PHP Webcam Capture Image Save from Camera using jQuery.In this post we will