Jump to content
Xtreme .Net Talk

Passing email data (strings) as array vs. collection vs. table


Recommended Posts

Posted

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

Posted

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!

  • Administrators
Posted
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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...