Am developing an app in iphone in which reports can be sent through email.
Have implemented it using MFMailComposeViewController framework. Is there a method to check whether the email is valid or not. I want to send out the repors only to a valid mail address. And also I want to check the status of the mail whether it is sent successfully or not?
Am developing an app in iphone in which reports can be sent through email.
Share
MFMailComposerViewController doesn’t have any provision to get the email address from it. You can set it via setToRecipients: method. But you can’t access what the user has actually typed inside the address fields.
And, the message will be actually queued in the Mail application’s outbox. And the doc clearly states that it doesn’t provide any way for you to know whether the mail is actually sent or not.
Another thing is that, if you allow the user to mail something to some mail address, then its his responsiblity to enter a correct mail address. If not, he won’t get the mail. Its upto him. Why do you even care?
An undocumented way: It seems this post shows an undocumented way to get access to the email text field by recursively looping through the mail composer’s subviews. This method may lead to your app’s rejection by Apple, or may cease to work in future if Apple changes the MFMailComposeViewController’s implementation.
Reference: A similar SO post here.