File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -140,11 +140,14 @@ export class GMailMocks {
140140 let headers = `Date: ${ msgData . date . toUTCString ( ) } \r\n`
141141 headers += `From: ${ msgData . from } \r\n`
142142 headers += `To: ${ msgData . to } \r\n`
143- if ( msgData . cc ) headers += `Cc: ${ msgData . cc } \r\n`
144- if ( msgData . bcc ) headers += `Bcc: ${ msgData . bcc } \r\n` // Note: BCC usually not in raw headers, but included for testing flexibility
143+ if ( msgData . cc && msgData . cc . length > 0 )
144+ headers += `Cc: ${ msgData . cc } \r\n`
145+ if ( msgData . bcc && msgData . bcc . length > 0 )
146+ headers += `Bcc: ${ msgData . bcc } \r\n` // Note: BCC usually not in raw headers, but included for testing flexibility
145147 headers += `Subject: ${ msgData . subject } \r\n`
146148 headers += `Message-ID: <${ msgData . id } @mail.gmail.com>\r\n` // Example Message-ID format
147- if ( msgData . replyTo ) headers += `Reply-To: ${ msgData . replyTo } \r\n`
149+ if ( msgData . replyTo && msgData . replyTo . length > 0 )
150+ headers += `Reply-To: ${ msgData . replyTo } \r\n`
148151 headers += `Content-Type: text/html; charset=utf-8\r\n` // Assuming HTML body for simplicity
149152 return `${ headers } \r\n${ msgData . body } `
150153 }
You can’t perform that action at this time.
0 commit comments