Skip to content

Multipart message has double line break after header #14

@mdsimmo

Description

@mdsimmo

When building a multipart message, I receive two line breaks after the header. Possibly related, there are also two line breaks at the end of the message.

Here is what the output looks like:

Message-ID: <175a169b74fdbff2.dd9fc513b5d45e31.fed9a95d3f7174ad@FA-0455>
Date: Fri, 28 Apr 2023 11:44:27 +0000
Content-Type: multipart/mixed; 
	boundary="175a169b74fe1006_7bd73ecd351eda46_fed9a95d3f7174ad"


--175a169b74fe1006_7bd73ecd351eda46_fed9a95d3f7174ad
Content-Transfer-Encoding: 7bit

Hello
--175a169b74fe1006_7bd73ecd351eda46_fed9a95d3f7174ad


This is the code to build the above message:

let builder = MessageBuilder::new()
  .body(MimePart { 
      contents: BodyPart::Multipart(vec![
          MimePart { 
              contents: BodyPart::Text(Cow::Borrowed("Hello")), 
              headers: vec![] }
      ]), 
      headers: vec![]
  });

println!("{}", builder.write_to_string()?);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions