Skip to content

Commit

Permalink
fix MIME generation error with several recipients
Browse files Browse the repository at this point in the history
Previously a semicolon was used to separate
different addresses.
Now the correct comma separator
is used instead.
  • Loading branch information
robert-virkus committed Jul 13, 2021
1 parent 7e9891d commit c04d1f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/mail_address.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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('>');
Expand Down
2 changes: 1 addition & 1 deletion lib/message_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<MailAddress> addresses) {
setHeader(name, addresses.map((a) => a.encode()).join('; '));
setHeader(name, addresses.map((a) => a.encode()).join(', '));
}

void _buildPart() {
Expand Down

0 comments on commit c04d1f5

Please sign in to comment.