Mailcore2:如何向邮件添加签名

时间:2014-06-09 06:40:49

标签: ios email-client mailcore2

MailCore2库中是否有可用于在电子邮件中添加签名的API?

1 个答案:

答案 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];