This the code i am using to send email.
function sendMessage(auth) {
var gmail =google.gmail('v1');
var email_lines =[];
email_lines.push("From:a@gmail.com");
email_lines.push("To:b@gmail.com");
email_lines.push('Content-type:text/html;charset=iso-8859-1');
email_lines.push('MIME-Version:1.0');
email_lines.push("Subject:Testing ");
email_lines.push("Hi,");
email_lines.push("Testing");
email_lines.push("<b>Hi</b>");
var email =email_lines.join("\r\n").trim();
var base64EncodedEmail = new Buffer(email).toString('base64');
base64EncodedEmail=base64EncodedEmail.replace(/\//g,'_').replace(/\+/g,'-');
gmail.users.messages.send({
auth,
'userId': 'me',
'resource': {
'raw': base64EncodedEmail
}
},function(err, response) {
if (err) {
console.log('The API returned an error: ' + err);
return;
}
console.log(response);
});
}
i am receiving bounce emails `An error occurred. Your message was not sent.
Hi, Testing Hi Date: Tue, 8 Nov 2016 01:35:08 -0800 Message-Id:`
Please help.