Skip to content

Commit

Permalink
deno fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-schaber committed Jan 27, 2023
1 parent 57e80cc commit 56759bb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions client/basic/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,24 @@ export class SMTPClient {
this.#connection.writeCmd(
`Content-Type: ${attachment.contentType}; name=${attachment.filename}`,
);

if (attachment.contentID) {
this.#connection.writeCmd(
`Content-ID: <${attachment.contentID}>`,
);
}

this.#connection.writeCmd(
`Content-Disposition: ${
attachment.contentDisposition || "attachment"
}; filename=${attachment.filename}`,
);

if (attachment.encoding === "base64") {
this.#connection.writeCmd(
"Content-Transfer-Encoding: base64\r\n",
);

for (
let line = 0;
line < Math.ceil(attachment.content.length / 75);
Expand All @@ -110,16 +110,16 @@ export class SMTPClient {
line * 75,
(line + 1) * 75,
);

this.#connection.writeCmd(lineOfBase64);
}

this.#connection.writeCmd("\r\n");
} else if (attachment.encoding === "text") {
this.#connection.writeCmd(
"Content-Transfer-Encoding: quoted-printable\r\n",
);

this.#connection.writeCmd(attachment.content + "\r\n");
}
}
Expand Down Expand Up @@ -287,20 +287,20 @@ export class SMTPClient {
content.relatedAttachments.map((v) => v.content).join("\n"),
new RegExp("--related([0-9]+)", "g"),
);

const relatedBoundary = `related${boundaryAddRel}`;
this.#connection.writeCmd(
`Content-Type: multipart/related; boundary=${relatedBoundary}\r\n; type=${content.mimeType}`,
);

this.#connection.writeCmd(`--${relatedBoundary}`);
this.encodeContent(content);

for (let i = 0; i < content.relatedAttachments.length; i++) {
this.#connection.writeCmd(`--${relatedBoundary}`);
this.encodeAttachment(content.relatedAttachments[i]);
}

this.#connection.writeCmd(`--${relatedBoundary}--\r\n`);
}

Expand Down

0 comments on commit 56759bb

Please sign in to comment.