Skip to content

Add support for inline images and message priority to Send-MailKitMessage cmdlet#52

Open
MisterZedd wants to merge 2 commits intoaustineric:masterfrom
MisterZedd:master
Open

Add support for inline images and message priority to Send-MailKitMessage cmdlet#52
MisterZedd wants to merge 2 commits intoaustineric:masterfrom
MisterZedd:master

Conversation

@MisterZedd
Copy link

Added a new InlineImages parameter of type Hashtable.

  • Allows embedding images in the HTML body using content IDs.
  • Uses MimePart with ContentDisposition = inline and adds them to BodyBuilder.LinkedResources.
  • Create a hashtable like @{contentId = filepath} and add <img src="cid:contentId"> to the email body.

Added a new Priority parameter with allowed values: Normal, High, Low.

  • Sets priority headers (X-Priority, X-MSMail-Priority, Importance) based on the selected priority.

added support for inline attachments and message priority.

Inline attachments can be added by creating a hashtable with structure:
@{contentId = filePath}
and adding this to the message body:
<img src="cid:contentId">
Then pass the hashtable into the -InlineAttachments parameter.
Fixed some incorrect variable names from previous commit.

Note: I incorrectly said -InlineAttachments in my previous commit. The parameter is -InlineImages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant