コード例 #1
0
        // ==================================================================对外方法

        /// <summary>
        /// 自己对自己发送邮件
        /// </summary>
        /// <param name="subject"></param>
        /// <param name="content"></param>
        public static void CustomeSend(string subject, string content)
        {
            EmailUtil se = new EmailUtil();

            se.AddGoalAdress(Sendadress);
            se.Emailbody = content;
            se.Emailhead = subject;
            se.Send();
        }
コード例 #2
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();
        }
コード例 #3
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();
        }