0

I am using following code to compose an email in XCode:

let mailComposerVC = MFMailComposeViewController()
mailComposerVC.setToRecipients(["xxx@yahoo.com"])
mailComposerVC.setSubject("subject 1")
mailComposerVC.setMessageBody(a_lot_of_content, isHTML: true)  // <-- What's the limit for `a_lot_of_content`?

At the last line, when setting the message body, is there a length limit for a_lot_of_content?

EDIT: I am not asking the maximum length of a NSString. Instead, would the limitation come from the mail protocol, the OS, the Mail app, the SDK, etc.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Joe Huang
  • 6,296
  • 7
  • 48
  • 81
  • @Larme are you sure setMessageBody can take that much length? If so, it's duplicate, if not, please... – Joe Huang May 31 '16 at 16:06
  • `setMessageBody:isHTML:` awaits for a `NSString` as its first parameter, so, it would be legit to think so. The only possible issue I can see, is that you could get a memory warning if you got too much data, but I'm not sure if that's possible. – Larme May 31 '16 at 16:07
  • @Larme So maybe someone knows more about it can answer the question in different perspective. I do not consider this question is the same as asking the maximum length of NSString. If so, I would have found the answer before asking this question. – Joe Huang May 31 '16 at 16:08
  • 2
    There's no guarantee that just because it takes a string, it takes any arbitrary length of string. It could be limited by the mail protocol, for all we know – Alexander May 31 '16 at 16:09
  • Is there a specific error you are receiving? Or is there a problem you are experiencing but not necessarily getting an error or is this just curiosity for future coding endeavors? – AtheistP3ace May 31 '16 at 16:18
  • @AtheistP3ace future coding endeavors... if you need to send a lot of dynamic content, wouldn't you be worried if it might exceed the limit? – Joe Huang May 31 '16 at 16:33
  • OK, yes i would. I was just attempting to help. I don't have the answer here I just wasn't sure if something else was going on that I may be able to help with by knowing an error. If you are just looking for an answer I don't have one. Sorry. =] – AtheistP3ace May 31 '16 at 16:34
  • @AtheistP3ace I understood your intention to isolate the problem, no worries and thanks for your attempt. – Joe Huang May 31 '16 at 16:38

0 Answers0