开发者

Mail comes Without Message content using MFMailComposeViewController in iPhone

开发者 https://www.devze.com 2023-01-28 04:46 出处:网络
I have faced some problems, when the user sent the mail. Some of the time the mail comes without message content(Email body), even the user typed the message content.The message content doesn\'t displ

I have faced some problems, when the user sent the mail. Some of the time the mail comes without message content(Email body), even the user typed the message content.The message content doesn't displayed only some times.(For 10 mail comes into my inbox, 2 or 3 messages comes without content in the email body) So please guide me why its happening?

Here my code is,

    - (void)viewDidLoad {

  [self displayComposerSheet];
    }

 -(void) displayComposerSheet
  {
       picker = [[MFMailComposeViewController alloc] init];

   picker.mailComposeDelegate = self;

   if ([MFMailComposeViewController canSendMail]) {

   [picker setToRecipients:[NSArray arrayWithObjects:@"aaa@bbb.com",nil]];

   [picker setSubject:@"Shou开发者_JS百科tOuts"];
   }
       [self presentModalViewController:picker animated:YES];

 }

Please Help me Out.

Thanks!


I don't have a straight answer, but two hints:

a) Why are you calling displayComposerSheet in viewDidLoad? I'd rather put it into viewWillAppear, since the view controller might already be loaded and in memory if used once again.

b) Did you try pre-filling the mail body with a placeholder text to see if that is being sent?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号