Node.js 如何在Nodejs中使用gmail api在同一对话中回复电子邮件
我正在使用Gmail.users.messages.send函数使用threadId向同一对话发送回复,但它不起作用Node.js 如何在Nodejs中使用gmail api在同一对话中回复电子邮件,node.js,email,google-api,gmail-api,Node.js,Email,Google Api,Gmail Api,我正在使用Gmail.users.messages.send函数使用threadId向同一对话发送回复,但它不起作用 gmail.users.messages.send({ auth: auth, userId: 'me', resource: { raw: raw, threadId:threadId }, }); 解决方案是在原始对象中添加“In Reply to”和“reference”,并使主题与您回复的邮件的主题相同
gmail.users.messages.send({
auth: auth,
userId: 'me',
resource: {
raw: raw,
threadId:threadId
},
});
解决方案是在原始对象中添加“In Reply to”和“reference”,并使主题与您回复的邮件的主题相同
const raw = {
"Content-Type: text/plain; charset=\"UTF-8\"\n" +
"MIME-Version: 1.0\n" +
"Content-Transfer-Encoding: 7bit\n" +
"References: <n4Frx80qe2_bE5H5bQhgcqGk=GwFN9gs7Z_8oZw@mail.gmail.com> <CDLLRQuSHMCXLOra1NW70jvoNgR+hU59BYg@mail.gmail.com>\n" +
"In-Reply-To: <CADsZLRwQWzLB-uq4_4G2E64NX9G6grn0cEeO0L=avY7ajzuAFg@mail.gmail.com>\n" +
"Subject: Re: your subject\n" +
"From: sender@gmail.com\n" +
"To: reciever@gmail.com\n\n" +
}
gmail.users.messages.send({
auth: auth,
userId: 'me',
resource: {
raw: raw,
},
});
const-raw={
“内容类型:文本/纯文本;字符集=\“UTF-8\”\n”+
“MIME版本:1.0\n”+
“内容传输编码:7比特\n”+
“引用:\n”+
“答复:\n”+
“主题:Re:您的主题\n”+
“发件人:sender@gmail.com\n“+
“至:reciever@gmail.com\n\n“+
}
gmail.users.messages.send({
auth:auth,
userId:'我',
资源:{
生的:生的,
},
});
Define它不起作用
正在发送邮件,但会为每个邮件创建一个新线程如何使用邮件提取API检索threadId
。另外,我已经找到了解决方案。您好,我们应该在引用和回复中传递什么值?