chatelain Posted October 19, 2005 Posted October 19, 2005 Hi, I'm googled out! How to pass email data from one function to another in a windows service. For Example: From, To, CC, Date, Subject, Body, ReplyTo, Attachment path, etc. Arrays, collections, tables....I just don't know which one is a good fit. The service gets new email from a pop3 server and creates support cases using the data in the email (From, To, ...). I would appreciate help on how to store and pass that data between functions, etc. Email size will be minimal but there will be numerous email to deal with. Thank you, Aaron Quote
Administrators PlausiblyDamp Posted October 19, 2005 Administrators Posted October 19, 2005 Could you not just create a class to hold the e-mail information and expose properties for the things you need to access (From, To etc) and just pass this between functions? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
chatelain Posted October 19, 2005 Author Posted October 19, 2005 Thanks for the reply PlausiblyDamp! I could create a class. Is is possible to have one of those properties as an array. I.e., I'll have multiple attachments and so I'll need to store each of their paths for that particular object. This array should also be dynamic. Thanks again! Quote
Administrators PlausiblyDamp Posted October 20, 2005 Administrators Posted October 20, 2005 Perfectly fine to use arrays, the only problem you might have is allowing the array to size itself - one of the classes under System.Collections may be more suitable e.g. Arraylist as these can grow dynamically. If you are using V2 of .Net then you might be better with one of the generic collection classes. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
chatelain Posted October 20, 2005 Author Posted October 20, 2005 Thanks again PlausiblyDamp! Perhaps someone can help me on this...I'm getting an error, " 'Set' parameter must have the same type as the containing property." Public Property eTo() As ArrayList Get Return _To.Clone() End Get Set(ByVal [color=Blue][u]Value[/u][/color] As Object) [color=Green]''Set' parameter must have the same type as the containing property.[/color] _To.Add(Value) End Set End Property Of course what I'm wanting to do is pass in an item to tack on the end of the arraylist rather than a whole arraylist object. Is this possible? Aaron Quote
Administrators PlausiblyDamp Posted October 20, 2005 Administrators Posted October 20, 2005 You can't have different types for the get and set - you are probably better off adding a method called Add (or similar) and using that to add to the ArrayList. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.