/// <summary> /// 进行Html文本内容的读取 /// </summary> /// <returns>返回所生成的Html文本内容数据</returns> internal protected virtual string ReadHtml() { if (string.IsNullOrEmpty(this.Html)) { return(""); } StringBuilder sb = new StringBuilder(); // sb.Append("--"); sb.Append(this.Boundary); sb.Append(MailCommon.NewLine); //分隔完成 sb.Append("Content-Type: text/html;"); sb.Append(MailCommon.NewLine); sb.AppendFormat(" charset=\"{0}\" ", this.SetCharset); sb.Append(MailCommon.NewLine); sb.AppendFormat("Content-Transfer-Encoding: "); if (this.EncodeType == MailEncodeType.BASE64) { sb.Append("base64"); sb.Append(MailCommon.NewLine + MailCommon.NewLine); sb.Append(Coding.Base64Encode(this.Html, this.Charset)); sb.Append(MailCommon.NewLine + MailCommon.NewLine); return(sb.ToString()); } //qp -- quoted-printable" sb.Append("quoted-printable"); sb.Append(MailCommon.NewLine + MailCommon.NewLine); sb.Append(Coding.EncodeQuotedPrintable(this.Html, this.Charset)); sb.Append(MailCommon.NewLine + MailCommon.NewLine); return(sb.ToString()); }
/// <summary> /// 进行QP头的编码 /// </summary> /// <param name="Src">要进行编码的串</param> /// <param name="enc">编码类型</param> /// <param name="Charset">文件字符集</param> /// <returns>返回编码后的串</returns> internal static string EncodQPHead(string Src, Encoding enc, string Charset) { return("=?" + Charset + "?Q?" + Coding.EncodeQuotedPrintable(Src, enc) + "?="); }