/// <summary>
        ///A test for SendMail
        ///</summary>
        public void SendMailTest()
        {
            HostSendMail target = new HostSendMail();
            EMail email = EMail.CreateEMail();

            email.UserName = "******";
            email.Password = "******";
            email.MailFrom = "*****@*****.**";

            email.DisplaySenderName = "GloriousFuture";
            email.MailToList = new List<string>{"*****@*****.**","*****@*****.**"};
            email.MailCCList = new List<string>();
            email.MailBCCList = new List<string>();
            email.Encoding = Encoding.UTF8;
            email.Subject = "GloriousFuture Subject";
            email.ContentBody = "GloriousFuture content body text \n <h4>Hellow mail!!<br /><a href='http://www.google.com.hk'>google</a></h4>";
            email.Host = "smtp.163.com";
            //mailEntity.Port = 465;
            email.TimeOut = 999999;
            email.Encoding = Encoding.UTF8; //Encoding.GetEncoding("GB2312"); ;
            email.IsBodyHtml = true;
            email.EnableSSL = true;

            bool expected = true;
            target.SendMail(email);
            bool actual = true;
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public static HostSendMail CreateHostSendMail()
 {
     HostSendMail hostSendMail = new HostSendMail();
     return hostSendMail;
 }