首页 > 代码库 > 发送邮件字符转换

发送邮件字符转换

      //將html轉為text         public string HtmlToText(string strContent)         {             strContent = strContent.Replace("&amp", "&");             strContent = strContent.Replace("‘‘", "‘");             strContent = strContent.Replace("&lt", " <");             strContent = strContent.Replace("&gt", ">");             strContent = strContent.Replace("&lt", "chr(60)");             strContent = strContent.Replace("&gt", "chr(37)");             strContent = strContent.Replace("&quot", "\"");             strContent = strContent.Replace(";", ";");             strContent = strContent.Replace(" <br />", "\n");             strContent = strContent.Replace(" ", " ");             return strContent;         }         //將text轉為html         public string TextToHtml(string strContent)         {             strContent = strContent.Replace("&", "&amp");             strContent = strContent.Replace("‘", "‘‘");             strContent = strContent.Replace(" <", "&lt");             strContent = strContent.Replace(">", "&gt");             strContent = strContent.Replace("chr(60)", "&lt");             strContent = strContent.Replace("chr(37)", "&gt");             strContent = strContent.Replace("\"", "&quot");             strContent = strContent.Replace(";", ";");             strContent = strContent.Replace("\n", " <br/>");             strContent = strContent.Replace(" ", " ");             return strContent;         }