Skip to content

Instantly share code, notes, and snippets.

@Sama-004
Created February 26, 2025 17:15
Show Gist options
  • Save Sama-004/73e4b4d2b1797d8031d3da41c398c9dc to your computer and use it in GitHub Desktop.
Save Sama-004/73e4b4d2b1797d8031d3da41c398c9dc to your computer and use it in GitHub Desktop.
const messageParts = [
`From: ${emailProvider.email}`,
`To: ${Array.isArray(data.to) ? data.to.join(', ') : data.to}`,
`Subject: ${encodeHeader(data.subject || '')}`,
`Date: ${date}`,
`Message-ID: ${data.messageId}`,
//this is what is causing the error
data.references?.length
? `References: ${data.references.join(' ')}`
: null,
data.inReplyTo ? `In-Reply-To: ${data.inReplyTo}` : null,
'MIME-Version: 1.0',
'Content-Type: multipart/alternative; boundary="boundary"',
'',
'--boundary',
'Content-Type: text/plain; charset=utf-8',
'Content-Transfer-Encoding: 7bit',
'',
body,
'',
'--boundary',
'Content-Type: text/html; charset=utf-8',
'Content-Transfer-Encoding: 7bit',
'',
htmlBody,
'',
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment