我正在使用Gmail APIs发送电子邮件。邮件已成功发送,但是发件人地址并没有像我所说的“Anup S via TestApp”一样显示。相反,它只显示了userID/email。
有没有关于如何修复这个问题的想法?
var email_lines = [];
email_lines.push("From: Anup S via TestApp <username@gmail.com>");
email_lines.push("To: to_user@gmail.com");
email_lines.push('Content-type: text/html;charset=iso-8859-1');
email_lines.push('MIME-Version: 1.0');
email_lines.push("Subject: New future subject here");
email_lines.push("");
email_lines.push("And the body text goes here");
email_lines.push("<b>And the bold text goes here</b>");
var email =email_lines.join("\r\n").trim();
var base64EncodedEmail = btoa(email);
var requestEmail = gapi.client.gmail.users.messages.send({
'userId': "me", // I also tried changing this - and (obviously) it does not work.
'message': {
'raw': base64EncodedEmail
}
});
有没有关于如何修复这个问题的想法?