GarrettG.
GarrettG.

Reputation: 3

Check to see if email is enabled?

I'm working on an iPhone app that, at a certain point, will try to send an email message. If the user has an email set up, great, if not, I need to change some actions accordingly. My question is how do I check to see if the user's iPhone has an email account setup? I've looked everywhere but I can't seem to find an answer.

I'm using MFMailViewController to send the message, but I don't want to create an instance of it unless I can actually send something. Any ideas?

Upvotes: 0

Views: 314

Answers (1)

Vladimir
Vladimir

Reputation: 170849

MFMailComposeViewController class has +canSendMail method which

Returns a Boolean indicating whether the current device is able to send email. (YES if the device is configured for sending email or NO if it is not.)

Upvotes: 4

Related Questions