npm install node-mailA node-mail tool for send email quickly (non promised)
```
$ npm install node-mail --save
##Options
var config = {
user : 'YOURS_EMAIL@gmail.com',
clientid : 'YOURS_CLIENT_ID',
clientSecret : 'YOURS_CLIENT_SECRET',
refreshToken : 'YOURS_REFRESH TOKEN'
}
STEP 1:
To get the ID and password will https://console.developers.google.com/project client and create a new web application project and select the field and redirect put https://developers.google.com/ oauthplayground.
STEP 2:
we go to the following link https://developers.google.com/oauthplayground and click on the button gear and put the id and password obtained and step 1.
STEP 3:
then we go and we added the application you want to authorize and give "https://mail.google.com/" button and press the button to authorize api and finally we just click Exchange authorization code for tokens.
` js
var nodemail = require('node-mail')
var email = nodemail.createEmail(options)
email.sendMail(toMsn,subjectMsn,textMsn,htmlMsn,function (err, response) {
// do something with response
})
email.sendMailAttach(toMsn,ccMsn,bccMsn,subjectMsn,textMsn,htmlMsn,nameFile,contentFile, function (err, response) {
// do something with response
});
``
Copyright (c) 2015 - Fabio Rojas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.