MFMailComposer - works in simulator but not in iPhone 2G
<p>I am trying to add MFMailComposer to my iPhone app and not having much luck getting it to launch in my iPhone 2G. It always launches the email app to the accounts page and closes my app.  Works like a charm in the simulator.</p>

<p>-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];</p>

<pre><code>[self displayComposerSheet];
</code></pre>

<p>}
-(void)displayComposerSheet 
{</p>

<pre><code>Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
if (mailClass != nil)
{
 // you have the MFMailComposeViewController class
 MFMailComposeViewController *picker =  [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;

NSArray *mailArr = [[NSArray alloc] initWithObjects:self.sendTo,nil];  

[picker setSubject:@"Hello from iCamp America"];
[picker setToRecipients:mailArr];
NSString *emailBody = @"\n\n\email created with iCamp America\nwww.iCampAmerica.com";
[picker setMessageBody:emailBody isHTML:NO];

[self presentModalViewController:picker animated:YES];
[picker release];
[mailArr release];
}
else
{
 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"You cannot send an email !" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
 [alert show]; 
 [alert release]; 
}
</code></pre>

<p>}</p>
