예제 #1
0
        /// <summary>
        /// Generate body of HTML document
        /// </summary>
        /// <param name="dataList">User's list</param>
        /// <returns></returns>
        public static string GenerateBody(List <Person> dataList)
        {
            StringBuilder result = new StringBuilder();

            for (int i = 0; i < dataList.Count; i++)
            {
                if (i != dataList.Count - 1)
                {
                    result.AppendLine($"<a href=\"mailto:{DataProcessing.Encode(dataList[i].Email)}\">{DataProcessing.Encode(dataList[i].Name)}</a> |");
                }
                else
                {
                    result.AppendLine($"<a href=\"mailto:{DataProcessing.Encode(dataList[i].Email)}\">{DataProcessing.Encode(dataList[i].Name)}</a>");
                }
            }

            return(result.ToString());
        }