Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ForwardMessage(reporter, message, messageId) {
let parsed = Mime.toMimeObj(message)
let encodedMessage = Base64.encode(message)
let emailObject = {
to: this.settings.forwardAddress,
from: reporter,
body: chrome.i18n.getMessage("forwardReportBody"),
subject: chrome.i18n.getMessage("forwardReportSubject") + parsed.subject,
attaches: [{
type: "text/plain",
name: messageId + ".txt",
base64: encodedMessage
}]
}
let mimeEmail = Mime.toMimeTxt(emailObject)
let emailContent = { "raw": btoa(mimeEmail).replace(/\//g, '_').replace(/\+/g, '-') }
this._API(
'POST', 'messages/send', emailContent,
(error, status, response) => { }
)
}