Passing multiple fields with multiple values in and out of functions in C#

I recently had a project where I had to acquire and manipulate a entire inbox worth of e-mails. I needed to capture the Subject, Body, To, From, CC, and BCC of each email. I also wanted to keep all the e-mails together and process them as group.
To do this I started with a custom data structure using the struct command like this:
public struct EmailTemplate
{
public string To;
public string From;
public string CC;
public string BCC;
public string Attachment;
public string Subject;
public string Body;
}
This creates a single object (called EmailTemplate) with different properties that contain the values for the different parts of the e-mail (body, subject, from, etc)
The next step is to create use the list<> data type to define a list variable. This will essentially define a list of EmailTemplate objects. It should look like this:
List<EmailTemplate> EmailList= new List<EmailTemplate>();
Now we have one List object (called “EmailList”) that is a list of EmailTemplate objects. We can now build a function to deal with all emails in the list as a set.
public List<EmailTemplate> EmailListOut (List<EmailTemplate> EMailListIn)
{
List<EmailTemplate> ProcessedEmails= new List<EmailTemplate>();
//Process emails and add them to this list ^
//Output this list:
return ProcessedEmails;
}
The above is an example of how you would create a function to accept a list of custom struct objects and return a list of custom struct objects.
I hope you find this helpfull
Happy Coding.