From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-28-2011 12:06 AM
I am trying to access an email attachment using .NET in LabVIEW. I've been able to get as far as receiving the emails as type Pop3Message, but I can't figure out how to access the attachments within the messages. There is a GetAttachedContents method that can be invoked to pull the contents (and attachments) from the email, but I can't figure out to invoke it. I have the inContents parameter, but I can't figure out what to do with the inPredicate parameter. (see example VI). If anyone can offer some assistance I'd be grateful!
This is the code I need to implement:
public static List<Pop3Content> GetAttachedContents(List<Pop3Content> inContents, Predicate<Pop3Content> inPredicate)
Pop3Message mg = ....;//get Pop3Message object with Pop3Client class
List<Pop3Content> contentList = Pop3Message.GetAttachedContents(mg.Contents, c => c.IsAttachment == true);
Int32 AttachmentCount = contentList.Count;
for (int i=0; i<contentList.Count; i++)
{
contentList[i].DecodeData("your file path");
}
09-28-2011 08:25 AM
You appear to be using a private assembly. The GetAttachedContents method is a static method. As such you would not wire in a class to the Invoke node. You can wire in an error cluster, but the "reference" input should be left disconnected. Other than that I can't really provide any more information since you are using a private assembly, and have provided no documentation.
09-28-2011 09:05 AM
Hi smercurio,
I think I'm close - it's all part of the higuchi.mail library. What I can't figure out is how to create the predicate object necessary to pass into the GetContents method.
09-28-2011 09:17 AM
This is what I have so far. The only thing I don't understand is what should be wired into the InPredicate input.
10-20-2011 12:51 PM
Hello.
Any luck in finding a solution for your problem?
I have a similar situation and need to retrieve an attachement as well from the email.
No documentation on the dll website is provided for that case..
10-21-2011 05:27 PM
Ammouri,
I'm not sure this will help, but here is some information on the inPredicate function microsoft calls.
http://msdn.microsoft.com/en-us/library/dd174479.aspx
Daniel
10-21-2011 06:13 PM
Thank you Daniel for you effort but this is not what I wanted. rwyost was trying to figure out what the inPredicate does and I have no clue on how to use the .Net classes.
I was trying to see whether he was able to get the attachement from the email or not. Sorry for that man, I should have mentioned that I am a newbie when it somes to .Net.