Ejemplo n.º 1
0
        public static void CustomSend_WithFile(string subject, string content, string to_splits, string filePath)
        {
            EmailUtil se = new EmailUtil();

            string[] tos = to_splits.Split(',');
            foreach (string to in tos)
            {
                se.AddGoalAdress(to);
            }
            se.Emailbody = content;
            se.Emailhead = subject;
            se.AddFile(filePath);
            se.Send();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 发送标准邮件:主题、内容
        /// </summary>
        /// <param name="subject">主题</param>
        /// <param name="content">内容</param>
        /// <param name="to_splits">收件人(多个使用英文逗号隔开)</param>
        public static void CustomSend(string subject, string content, string to_splits)
        {
            EmailUtil     se  = new EmailUtil();
            List <string> tos = new List <string>();

            if (to_splits.IndexOf(",") > -1)
            {
                tos = to_splits.Split(',').ToList();
            }
            else
            {
                tos.Add(to_splits);
            }
            foreach (string to in tos)
            {
                se.AddGoalAdress(to);
            }
            se.Emailbody = content;
            se.Emailhead = subject;
            se.Send();
        }