public static MailItem[] GenerateMailItemListToSend(string from, MailUserList destList, string subject, string body, string bodyHtml,
                                                            MailUtilResourceFile[]?resourceFiles, MailUtilAttachedFile[]?attachedFiles)
        {
            if (resourceFiles == null)
            {
                resourceFiles = new MailUtilResourceFile[0];
            }
            if (attachedFiles == null)
            {
                attachedFiles = new MailUtilAttachedFile[0];
            }

            SortedList <string, MailItem> list = new SortedList <string, MailItem>();

            foreach (MailUser u in destList.UserList)
            {
                MailItem m = new MailItem(from, u, subject, body, bodyHtml, resourceFiles, attachedFiles);

                if (list.ContainsKey(m.Hash) == false)
                {
                    list.Add(m.Hash, m);
                }
            }

            List <MailItem> ret = new List <MailItem>();

            foreach (MailItem m in list.Values)
            {
                ret.Add(m);
            }

            ret.Sort();

            return(ret.ToArray());
        }
 public static MailItem[] GenerateMailItemListToSend(string from, MailUserList destList, string subject, string body)
 {
     return(GenerateMailItemListToSend(from, destList, subject, body, "", null, null));
 }