Closed MihaIvan closed 2 years ago
Hi @MihaIvan, In your sample you need to change this: $Recipients = [MimeKit.InternetAddressList]::new
To this: $Recipients = [MimeKit.InternetAddressList]::new()
Regarding documentation - there isn't additional documentation beyond the example since that includes usage and datatypes, there isn't much else to include.
I tried this, and it is not working. Sorry to be a bother. It looks like it cannot find the Mime objects.
Line |
7 | $From = @.*** …
| ~~~~~~~~
| Unable to find type [MimeKit.MailboxAddress].
InvalidOperation: C:\Users\MikeL\Documents\PowerShell Scripts\Test Email.ps1:8:15
Line |
8 | $Recipients = [MimeKit.InternetAddressList]::new()
| ~~~~~~~~~
| Unable to find type [MimeKit.InternetAddressList].
InvalidOperation: C:\Users\MikeL\Documents\PowerShell Scripts\Test Email.ps1:11:18
Line |
11 | @.*** …
| ~~~~~~~
| Unable to find type [MimeKit.InternetAddress].
From: Eric Austin @.> Sent: Thursday, September 15, 2022 3:09 PM To: austineric/Send-MailKitMessage @.> Cc: Mike Lusicic @.>; Mention @.> Subject: Re: [austineric/Send-MailKitMessage] No add method for MimeKit.InternetAddressList (Issue #29)
Hi @MihaIvanhttps://github.com/MihaIvan, In your sample you need to change this: $Recipients = [MimeKit.InternetAddressList]::new
To this: $Recipients = [MimeKit.InternetAddressList]::new()
Regarding documentation - there isn't additional documentation beyond the example since that includes usage and datatypes, there isn't much else to include.
— Reply to this email directly, view it on GitHubhttps://github.com/austineric/Send-MailKitMessage/issues/29#issuecomment-1248560782, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACTBPNYWGZFLIUOMDLYRUHTV6N66BANCNFSM6AAAAAAQNPRJFA. You are receiving this because you were mentioned.Message ID: @.***>
That error is a result of not running this statement at the beginning of the script: using module Send-MailKitMessage
That brings the required packages like MimeKit into scope for the session.
I followed the example to create a send a message. Here is an excerpt from the code:
This produces the error below:
Further down I have the send coded as thus:
This gives this error:
By the way, where is the documentation for this? Surely there is more than just the example. Also, when trying to update the help, it says it could not update the help for this object.