how to get email addresses from mail composer - iphone

How do you get the email addresses that the mail composer sent to was?
I tried looking at this delegate:
- (void)mailComposeController:(MFMailComposeViewController *)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError *)error
{
}
but it seems that there's no way to get the email addresses

You can't. The interface is designed such that what the user enters is not visible to you.
If you tell us what you're trying to accomplish, we may be able to suggest an alternate API or solution.

You can't get the email addresses from mail composer.
One suggestion:
If you know the name of the intended recipients, you can get the email addresses from the address book. Note that you will need to inform your users of the app's action, preferably with an option for them to proceed or cancel the action.

Please go through my same question, on which finally I concluded that There are no official Apple's API to get email addresses...
Retrieve E-mail in In-app in iPhone

Related

send Email without showing MFMailcomposeviewcontroller [duplicate]

This question already has answers here:
Send mail without MFMailComposeViewController
(3 answers)
Closed 9 years ago.
I am working with an app. In which user requirement is that send patient form via email to specific email account. Problem is that email will be send without showing mfmailcomposeviewcontroller. Mean to say user will press one submit button then email sent to user account without mfmailcomposeviewcontroller from iPhone device. is it possible? Can any one help me ? Please send me any example of that work. I have lot of searching on this point unfortunately I can't found any result.
Apple not providing the Mail frameworks for send email without showing MFMailcomposeviewcontroller.
Sending emails programmatically, without user intrection, from an iphone application, cannot be implemented using any of the Apple frameworks.
It could be possible in a jailbroken phone but then it would never see the inside of App Store.
For original answer :
If you want control of email sending, then it's a better way would be to set up a web service (at your server end) you can post to using an HTTP request. If you are posting to only one address this can work very well, although you may want to get the user to input their return mail address.
This is not supported by the iPhone SDK, probably because Apple doesn't want you to do it.
Why not? My guess: Because it's easy to abuse. If we knew user's email address, we could spam them, we could fake emails from them, etc. Imagine finding out an iPhone app sent an email as you without your knowledge -- not cool, even if the app had good intentions.
So, anything you do to get around that, is likely to get you rejected from the app store.
Having said all that, you could basically write your own smtp interaction code to chat with the user's outgoing mail server. For example, if the user has a gmail account, you could ask them for their email and password, you'd have to know how to talk to the gmail servers, and send email through them.
Going that route means asking the user for their username, password, and either asking for or figuring out their mail server information. Another choice is to send directly from the phone (your own smpt server, not just a client), which is a bit more coding. And if you write your own server, the mail you send is more likely to be blocked since your originating IP might not match the domain on the sender's email.
There also exist some libraries that might help out
Open Source Cocoa/Cocoa-Touch POP3/SMTP library?
Bilal, i think you not use this
if ([MFMailComposeViewController canSendMail] )
{
MFMailComposeViewController *mailController = [[MFMailComposeViewController
alloc] init];
[mailController setMailComposeDelegate:self];
[mailController setSubject:#"Patient Form"];
[mailController setMessageBody:increments isHTML:YES ];
[mailController setToRecipients:[NSArray arrayWithObject:#"email id"]];
[self presentViewController:mailController animated:NO completion:nil];
}
use it on the click of submit button, i hope it helps you

Can we get the From email address that is set in MFMailComposeViewController?

I am able to get Recipient email address from the MFMailComposeViewController using http://jomnius.blogspot.com/2011/02/how-to-find-mfmailcomposeviewcontroller.html link.
But I want From email Address. So is their any way to get From email Address...
Any links related to this is also welcome...
thanks..
I assume you want to fetch User's Configured email address in iPhone. If so, You can't fetch email configuration of iOS devices due to privacy issues.

Using MFMailComposeViewController, is it possible to BCC the default mail account?

I believe that the iOS SDK provides no access to the details of the default mail account (for good reason), but is there any other way to somehow setup MFMailComposeViewController to prefill the BCC field with the "from" address?
Am I overlooking something obvious or is the only way for the user to fill in the BCC herself?
That information is not accessible via the public API.
Make them input their email on first launch? Perhaps search the Address Book for entries like "Me", or something similar?
-[MFMailComposeViewController setBccRecipients:]
There is no way for the app to do this itself. However, MFMailComposeViewController will pre-fill the BCC field with the FROM address if the user has turned on the Mail setting for "Always Bcc Myself".

Waiting until an email has been sent on iOS?

My app allows the user to send an email through MFMailComposeViewController. While the email is being sent, I'd like to display an activity indicator. Problem is I can't find a way to know when it's been sent. The delegate is only being told whether the mail was placed in the outbox:
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
Is there any way to know whether an email has been sent on iOS?
I think you're out of luck, sort of. Once the email gets passed to the Mail app, you lose track of it, and it becomes the responsibility of the Mail app alone. And there isn't a way to even poll the Mail app to determine if an email has been sent.
But as long as the device has a network connection and the user has an email account set up, you're pretty much guaranteed the email will be sent, assuming you don't get an error returned to you. And you can always pre-check for network connectivity and email access before you attempt to present the MFMailComposeViewController.

Are there other methods than emailing a verification link to verify account info?

At the moment, we are sending an email address verification email each time someone signs up. This email has been causing a number of problems: people don't get it, they just don't click the link in the email or the email gets block by spam or some other method. We are working on resolving the spam issue, although I don't think it's possible to completely resolve it.
I'm wondering what other methods there might be for verifying and email address. Is there any other way to verify an email address without sending an email? Or is there another method of ensuring people aren't signing up with fake information?
I'm not sure if there are other good methods, but sending an email and having them click a link is definitely the simplest and most accurate.
A main feature to sending that email, is for the person to verify that it's actually them that requested it.
The only way to verify someone owns an email address is to have him use it.
As for verifying users don't enter fake information - not even sending an email can help. With so many disposable/temporary email services out there (like GuerrillaMail) , someone can fill up your form with false info, post a temp email address, log to that address and click the link in your email - manually or programatically.
You have to trust your users to come back for your content, and ignore spammers.
strikeiron.com offers a paid web service to verify if an email exists without sending a message to that email. try it out here is the link: strick
http://www.strikeiron.com/Catalog/ProductDetail.aspx?pv=5.0.0&pn=Email+Verification