如何通过电子邮件发送属性字符串?
mailComposerVC.setMessageBody(textView.attributedString, isHTML: false)
您已将属性字符串转换为 HTML 字符串。使用以下代码生成 html 字符串。
do {
let data = try string.dataFromRange(NSMakeRange(0, string.length), documentAttributes: [NSDocumentTypeDocumentAttribute : NSHTMLTextDocumentType])
let htmlString = String(data: data, encoding: NSUTF8StringEncoding)
}catch {
}
使用生成的 html 字符串作为
mailComposerVC.setMessageBody(htmlString, isHTML: true)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)