mirror of
https://github.com/ovosimpatico/smtp-loadbalancer.git
synced 2026-01-15 08:23:37 -03:00
Support for sender display names
This commit is contained in:
@@ -68,9 +68,16 @@ export class SMTPClient {
|
||||
};
|
||||
}).filter(Boolean); // Remove null entries
|
||||
|
||||
// FROM field with display name if available
|
||||
let fromField = provider.from;
|
||||
if (emailData.fromName) {
|
||||
// Format as "Display Name <email@address.com>"
|
||||
fromField = `${emailData.fromName} <${provider.from}>`;
|
||||
}
|
||||
|
||||
// Prepare email
|
||||
const mailOptions = {
|
||||
from: provider.from,
|
||||
from: fromField,
|
||||
to: emailData.envelope.to,
|
||||
subject: emailData.subject || '(No Subject)',
|
||||
text: emailData.text,
|
||||
|
||||
@@ -110,6 +110,8 @@ export class IncomingSMTPServer {
|
||||
to: session.envelope.rcptTo?.map((r) => r.address) ||
|
||||
parsed.to?.value.map((t) => t.address) || [],
|
||||
},
|
||||
// Preserve sender display name if it exists
|
||||
fromName: parsed.from?.value[0]?.name || parsed.from?.text || null,
|
||||
subject: parsed.subject,
|
||||
text: parsed.text,
|
||||
html: parsed.html,
|
||||
|
||||
Reference in New Issue
Block a user