Trying to Read a string in Powershell from an email with IMAP connect:
I use the Mail.dll from http://www.lesnikowski.com/mail/ Docu: http://www.lesnikowski.com/mail/documentation/
I want to search for a specific Subject.
What i have so far:
[Reflection.Assembly]::LoadFile("c:\mail.dll")
$imap = new-object Lesnikowski.Client.IMAP.Imap
$imap.Connect("192.168.0.1")
$imap.User = "user"
$imap.Password = "xxxx"
$imap.login()
$imap.Select("Inbox.folder.subfolder") #instead of $imap.selectinbox() i select a subfolder
$imap.GetMessage()
$imap.GetMessage() now lists one email, i think the last one.. but i want one with a specific subject.
The Doku gives following example but i am not able to handle this im Powershell:
List<long> uids = imap.Search().Where(Expression.Subject("report")).Sort(SortBy.Date()).GetUIDList();
I think i probably went in trouble with my tests because the "Where" is also a native Posh-Command... It always ended in a missing ) error ...