diff --git a/lib/mail_address.dart b/lib/mail_address.dart index d0207c1c..b7503b7e 100644 --- a/lib/mail_address.dart +++ b/lib/mail_address.dart @@ -43,13 +43,13 @@ class MailAddress extends OnDemandSerializable { } String encode() { - if (personalName == null) { + final pName = personalName; + if (pName == null) { return email; } var buffer = StringBuffer() ..write('"') - ..write(MailCodec.quotedPrintable - .encodeHeader(personalName!, fromStart: true)) + ..write(MailCodec.quotedPrintable.encodeHeader(pName, fromStart: true)) ..write('" <') ..write(email) ..write('>'); diff --git a/lib/message_builder.dart b/lib/message_builder.dart index 7175c1af..d0bbf196 100644 --- a/lib/message_builder.dart +++ b/lib/message_builder.dart @@ -405,7 +405,7 @@ class PartBuilder { /// Adds the header with the specified [name] with the given mail [addresses] as its value void setMailAddressHeader(String name, List addresses) { - setHeader(name, addresses.map((a) => a.encode()).join('; ')); + setHeader(name, addresses.map((a) => a.encode()).join(', ')); } void _buildPart() {