MailCore2库中是否有可用于在电子邮件中添加签名的API?
答案 0 :(得分:0)
按原样获取您的电子邮件正文:
NSString *oldEmailBodyString = [emailWebView stringByEvaluatingJavaScriptFromString:@"document.documentElement.innerHTML"];
然后为你添加签名:
NSString *signature = @"<p>Sent from my iPhone</p>";
NSString *newEmailBodyString = [NSString stringWithFormat:@"<html>%@ %@</html>", oldEmailBodyString, signature];
从字符串加载新的电子邮件正文:
NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
NSURL *baseURL = [NSURL fileURLWithPath:bundlePath];
[emailWebView loadHTMLString:newEmailBodyString baseURL:baseURL];