只有GmailMessage.forward一個htmlBody選項。但是如果你使用它,那么轉發的電子郵件不包括原始電子郵件的正文/內容。它只包括您放入的內容htmlBody。
如何轉發電子郵件、添加文本并包含原始正文?
var message = GmailApp.search(`...`)[0].getMessages()[0];
message.forward("...", {
"htmlBody" : "hi"
});
uj5u.com熱心網友回復:
您需要獲取要轉發的訊息的正文:
function myFunction() {
var message = GmailApp.search(`to:[email protected]`)[0].getMessages()[0];
forwarded = message.getBody(); // that is the body of the message we are forwarding.
message.forward("[email protected]", {
"htmlBody" : "My email test?<br><br>" //adds your message to the body
"<div style='text-align: center;'>---------- Forwarded message ----------</div><br>" forwarded, //centers
});
}
我通過搜索發送到特定電子郵件地址的郵件并轉發到 hotmail 電子郵件地址,根據您的代碼制作了一個示例代碼。
編輯:
參考代碼和獲取電子郵件正文的重要性可以在這個執行緒中找到
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/473306.html
上一篇:吐司沒有出現?
