Skip to content

Instantly share code, notes, and snippets.

@JaiParakh
Last active June 14, 2019 03:26
Show Gist options
  • Save JaiParakh/fc68f614ab6a9b059020d8c4f24771ee to your computer and use it in GitHub Desktop.
Save JaiParakh/fc68f614ab6a9b059020d8c4f24771ee to your computer and use it in GitHub Desktop.
//Send the message to specified receiver.
sendMail(encodedMessage){
this.gmail.users.messages.send({
userId: this.me,
resource: {
raw: encodedMessage,
}
}, (err, result) => {
if(err){
return console.log('NODEMAILER - The API returned an error: ' + err);
}
console.log("NODEMAILER - Sending email reply from server:", result.data);
});
}
//Saves the draft.
saveDraft(encodedMessage){
this.gmail.users.drafts.create({
'userId': this.me,
'resource': {
'message': {
'raw': encodedMessage
}
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment