In an iPhone app,I want to send an email to a person who has forgotten about their passcode . I want to send the mail in background (cant use MFMailComposeViewController for this) and also the app must not be pushed to background . Is there a way to achieve this?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do I make a forward e-mail link?
- Popover segue to static cell UITableView causes co
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
The best way of doing this is using SKPSMTPMessage. You can download it from here: https://github.com/jetseven/skpsmtpmessage This is a very easy solution that I have used before for using "Forgot Password" solutions in iOS apps. To implement simply drag the downloaded files into your application,
#import
the the "SKPSMTPMessage.h" into your class, and implement the following code:.h
.m
Also be sure to include the following methods in the .m. You can change the contents of the UIAlertViews depending on what you want to display to the user.
You also need to do the following before this will work. Your Target -> Get Info -> Build -> All Configurations -> Other Link Flags: "-ObjC" If you need help with this, see http://developer.apple.com/qa/qa2006/qa1490.html
EDIT: * CFNetwork.framework must also be added for this to work! *
Let me know if you have any more questions.
Thanks, Jacob
https://github.com/troyz/MailUtil
I have used library above to send mail in background, so it works.
Swift code is here:
You CAN send email in the background (without using the default MFMail Controller). BUT you still need the user to fill out whatever form (or content you want to email) and have them click "Send".
Here is my post on how to do it. It includes code and images.
Locking the Fields in MFMailComposeViewController
P.S. this works and Apple has approved over 10 of my apps that use this code/method.
Download SKPSMTP Library and import
Then implement the method for sending mail in background.
To handle the success and fail use
and
You cannot send SMS/Email without user acceptance. But there are a lot of web-services in internet which can send SMS/Email. I guess some app uses those services or uses own.
You can't use
MFMailComposeViewController
to do this. No API will allow you to send emails or any kind of message on behalf of the user without he seeing it.The only I see is to make a call to your server and the server send the email, something like this: