Exemplo n.º 1
0
        public void SendDemo()
        {
            string smtpHost = "smtp.163.com";
            string from = "*****@*****.**";
            string pwd = "26082408163";
            string to = "*****@*****.**";
            DataTable t1 = new DataTable();
            t1.Columns.Add("Id");
            t1.Columns.Add("Name");
            t1.Columns.Add("Age");
            for (int i = 0; i < 50; i++)
            {
                t1.Rows.Add(new object[] { 1000 + i, "Name" + i, 25 + i });
            }

            JMailConfig config = new JMailConfig(from, "张旭辉", pwd, smtpHost);
            JMail email = new JMail();
            JMail.Config = config;
            JMailBody body = new JMailBody().Append(t1).Append("一大段Html");
            email.Send(to, "邮件测试", body);
        }
Exemplo n.º 2
0
        public void SendDemo()
        {
            string    smtpHost = "smtp.163.com";
            string    from     = "*****@*****.**";
            string    pwd      = "26082408163";
            string    to       = "*****@*****.**";
            DataTable t1       = new DataTable();

            t1.Columns.Add("Id");
            t1.Columns.Add("Name");
            t1.Columns.Add("Age");
            for (int i = 0; i < 50; i++)
            {
                t1.Rows.Add(new object[] { 1000 + i, "Name" + i, 25 + i });
            }

            JMailConfig config = new JMailConfig(from, "张旭辉", pwd, smtpHost);
            JMail       email  = new JMail();

            JMail.Config = config;
            JMailBody body = new JMailBody().Append(t1).Append("一大段Html");

            email.Send(to, "邮件测试", body);
        }