Skip to content

Commit

Permalink
feat: content-id for attachment (#28)
Browse files Browse the repository at this point in the history
* feat: content-id for attachment

* format files
  • Loading branch information
mathe42 authored Jun 9, 2022
1 parent afc1652 commit 54daa5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/basic/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ export class SMTPClient {
"name=" + attachment.filename,
);

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

await this.#connection.writeCmd(
"Content-Disposition: attachment; filename=" + attachment.filename,
);
Expand Down
1 change: 1 addition & 0 deletions config/mail/attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { base64Encode } from "./encoding.ts";
interface baseAttachment {
contentType: string;
filename: string;
contentID?: string | number;
}

export type Attachment =
Expand Down

0 comments on commit 54daa5c

Please sign in to comment.