tags:

views:

35

answers:

1

I am invoking mail application from my mail using messageUI and MFMailComposer. but in iphone os 4.0 if the mail account is not configured,the application crashes while showing the device specific alert to configure the mail account.what can be the solution for this? can this be os issue or device specific issue. Because it works fine on ipod touch with os 3.0

+1  A: 

Hi Javal,

You need to check whether the client is configured for mail before displaying the mail composition interface. Use the class method +(BOOL)canSendMail from the MFMailComposeViewController to do this. e.g.

if ([MFMailComposeViewController canSendMail]) {
    // show a mail composition view
} else {
    // advise user to set up a mail account and try again
} 
Simon Whitaker
Hey Thanks issue solved
Javal Nanda
Excellent! Glad it helped - good luck with your app! :)
Simon Whitaker