private bool SendSysEmail()
        {
            string token = Math.Abs(Guid.NewGuid().GetHashCode()).ToString(CultureInfo.InvariantCulture);
            var    url   = string.Format("{4}/account/chkmail?userid={0}&useremail={1}&stamp={2}&code={3}", "lfyao", HttpUtility.UrlDecode("*****@*****.**"), DateTime.Now.Ticks, token, "wwww.test.com");
            var    body  = new StringBuilder();

            body.AppendLine(string.Format("您的用户名:{0}<br>", "姚立峰"));
            body.AppendLine(string.Format("<a href='{0}'>立即验证邮箱</a><br>", url));
            body.AppendLine("您也可以点击以下链接完成验证邮箱(72小时内有效):<br>");
            body.AppendLine(url);
            body.AppendLine("<br>(若该链接无法点击,请直接复制链接至浏览器地址栏中访问)");

            ISmtpMail mail = new SysMailMessage();

            mail.Subject            = "密码激活";
            mail.MailDomain         = "smtp.exmail.qq.com";
            mail.MailDomainPort     = 25;
            mail.MailServerUserName = "******";
            mail.MailServerPassWord = "******";
            mail.From          = "*****@*****.**";
            mail.FromName      = "姚立峰";
            mail.Body          = body.ToString();
            mail.RecipientName = "*****@*****.**";
            mail.AddRecipient("*****@*****.**", "*****@*****.**");

            return(mail.Send());
        }
Esempio n. 2
0
 private void SendMail(string email, string username, string mq, string password)
 {
     //ESM..Priority = "Normal";
     ESM.AddRecipient(email);
     ESM.MailDomainPort = config.Port;
     ESM.From           = config.Sysemail; //设定发件人地址(必须填写)
     ESM.FromName       = config.FromName;
     ESM.Html           = true;            //设定正文是否HTML格式。
     ESM.Subject        = "你的客户给你留下了新信息呦,很久没在同业MQ上看到你了!";
     ESM.Body           = "" + EmailTemplate.Replace("{username}", username).Replace("{passwd}", password) + "";
     ESM.MailDomain     = config.Smtp;
     //也可将将SMTP信息一次设置完成。写成
     ESM.MailServerUserName = config.Username;
     ESM.MailServerPassWord = config.Password;
     ESM.Send();
 }
Esempio n. 3
0
File: Program.cs Progetto: radtek/QM
 private static void test()
 {
     try
     {
         Console.Write("1234");
         log.Debug("1234");
         SysMailMessage m = new SysMailMessage();
         m.FromName = "Junxiao Liang";
         m.Subject  = "123";
         m.AddRecipient("*****@*****.**");
         m.Body = "test";
         m.Send();
         log.Debug("done");
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 4
0
 private void SendMail(string email, string username, string mq, string password)
 {
     if (string.IsNullOrEmpty(email))
     {
         return;
     }
     //ESM..Priority = "Normal";
     ESM.AddRecipient(email);
     ESM.MailDomainPort = config.Port;
     ESM.From           = config.Sysemail; //设定发件人地址(必须填写)
     ESM.FromName       = config.FromName;
     ESM.Html           = true;            //设定正文是否HTML格式。
     ESM.Subject        = "赶紧登陆同业MQ吧,您有一条留言消息,客户等着您报价呢!";
     ESM.Body           = "" + EmailTemplate.Replace("{username}", username).Replace("{passwd}", password) + "";
     ESM.MailDomain     = config.Smtp;
     //也可将将SMTP信息一次设置完成。写成
     ESM.MailServerUserName = config.Username;
     ESM.MailServerPassWord = config.Password;
     ESM.Send();
 }