我正在使用 Gmail API 发送电子邮件。电子邮件已正确发送,但未显示发件人地址,因为我提到了 "Anup S via TestApp" 。相反,它只是显示用户 ID/电子邮件。
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
}
});
有想法该怎么解决这个吗?