예제 #1
0
 public static void Notify(PostComment comment)
 {
     MailMessage message = new MailMessage();
     message.From = new MailAddress(ConfigurationManager.AppSettings["Email"]);
     message.To.Add(new MailAddress(ConfigurationManager.AppSettings["Email"]));
     message.Subject = string.Format("New Comment @ {0}", ConfigurationManager.AppSettings["Url"]);
     message.IsBodyHtml = true;
     StringBuilder sb = new StringBuilder();
     sb.AppendFormat("<P><b>{2}</b> ({3}) posted a <a href='{0}ShowPost.aspx?id={1}'>new comment</a> to {0}.</P>",
         ConfigurationManager.AppSettings["Url"], comment.Post.Id, comment.Comment.OwnerLogin.Name, comment.Comment.OwnerLogin.Email);
     ReferencesRedirector redirector = new ReferencesRedirector(comment.Post.Id, "Post");
     sb.AppendFormat("<P>{0}</P>", Renderer.RenderEx(
         comment.Comment.Text, ConfigurationManager.AppSettings["url"], redirector.ReferUri));
     message.Body = sb.ToString();
     SmtpClient client = new SmtpClient();
     client.Send(message);
 }
예제 #2
0
파일: Page.cs 프로젝트: dblock/dblog
    public virtual string RenderEx(string text, int id)
    {
        if (string.IsNullOrEmpty(text))
            return string.Empty;

        ReferencesRedirector redirector = new ReferencesRedirector(id, "Post");
        return Renderer.RenderEx(Cutter.DeleteCut(text), ConfigurationManager.AppSettings["url"], redirector.ReferUri);
    }