Esempio n. 1
0
 public static void RaiseAccountRegister(Account account)
 {
     if (AccountRegisterEvent != null)
     {
         AccountRegisterEvent(null, account);
     }
 }
        /// <summary>
        /// 用户注册 发送通知邮件事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        static void CustomRaiseEvent_AccountRegisterEvent(object sender, Account e)
        {
            Task.Factory.StartNew(() =>
            {
                MailMessage mailMessage = new MailMessage(new MailAddress("*****@*****.**", "蒋春"), new MailAddress("*****@*****.**", e.PhoneNumber));
                mailMessage.Subject = "用户注册通知";
                mailMessage.Body = e.PhoneNumber + ":" + e.MT4Account + ":" + e.MT4Pwd;
                mailMessage.IsBodyHtml = true;

                SmtpClient client = new SmtpClient("smtp.163.com");
                client.Credentials = new NetworkCredential("*****@*****.**", "****");
                client.Send(mailMessage);
            });
        }