asp.net中的编辑器控件问题 [英] Problem with Editor Control in asp.net

查看:74
本文介绍了asp.net中的编辑器控件问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在应用程序中使用了所见即所得的编辑器控件.创建了内容管理系统来发送电子邮件通知,但电子邮件订阅者正在获取带有HTML标签的电子邮件

如何从电子邮件中删除标签?

我还将存储在编辑器中的文本也存储在数据库中,这里存储的包括标签,
并在电子邮件中显示带有标签的相同数据.

是编辑器还是我的代码有问题?
代码如下:

Hi,

I am using WYSIWYG editor control in my application.Created Content Management system to send email notification,but email subscribers are getting email with HTML tags

How to remove the tags from email?

I am storing text present in editor in database also,here it stored including tags,
and same data displaying in email with tags also.

Is the problem with editor or my code?
The code as follows:

  SmtpClient smtpClient = new SmtpClient();
    MailMessage message = new MailMessage();
    try
    {
        StringBuilder sb = new BAL.PageContent().EmailList();
        string s = sb.ToString().Trim().TrimEnd('','');

        MailAddress fromAddress = new MailAddress("info@captorsolutions.com");
        message.From = fromAddress;//here you can set address
        message.To.Add(s);
        message.Subject = "Aghoryan Email Notification";//subject of email
        // message.CC.Add("cc@site.com");//ccing the same email to other email address
        //message.Bcc.Add(new MailAddress("bcc@site.com"));//here you can add bcc address
        message.IsBodyHtml = true;//To determine email body is html or not
        message.Body = string.Format("<html><body>" + ucEditor1.Content + "</body></html>");
        smtpClient.Send(message);
    }
    catch (Exception ex)
    {
        //throw exception here you can write code to handle exception here
    }
}



谢谢..



Thanking you ..

推荐答案

您必须确保接收电子邮件的客户端已启用HTML查看功能,否则它们将以纯文本格式接收此内容.您是否已通过将其发送给自己来进行测试?检查您的电子邮件应用程序设置.
You have to make sure that the clients that recieve the email has HTML Viewing enabled otherwise they will receive this content in plain text format. Have you tested this by sending it to yourself? Check your Email Application settings.


这篇关于asp.net中的编辑器控件问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆