Send mail without MFMailComposeViewController
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. Previous related question:
- Open Source Cocoa/Cocoa-Touch POP3/SMTP library?
Send an email from my app without using MFMailComposeViewController
You can do it only by creating own server-side mailer. On button clicking you have to send request with all needed data (email address, body, subject, etc) and server will send mail.
If You want send directly from app - MFMailComposeViewController is the only LEGAL way
Send email without user interaction in iOS App
The simple answer is "No".
It is against Apple guidelines. You cannot send mail without user interaction (action on send button).
As an alternate option, you can use power of web server/web service. Send information/data to your web service using web service request and can send an email from you web server. (Note: Mail sender id will not be email id of application user.)
You can try this but remember, it's against Apple guidelines and Apple may reject your app.
- https://stackoverflow.com/a/5183267/5638630
- http://iosameer.blogspot.in/2013/01/sending-e-mail-in-background-from-ios_25.html
- https://stackoverflow.com/a/6287412/5638630
Sending Email without using MFMailComposeViewController
Take a look at this answer.
Locking the Fields in MFMailComposeViewController
If you follow the instructions you can create your own custom View then send email. Without having to use the default MFMessageCompserViewController .
How to send mail from iphone app without showing MFMailComposeViewController?
Sending emails programmatically, without user intervention, 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.
If you want control of email sending, then 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.
Otherwise only the standard dialog is available (this relies on using whatever account they've setup on the device).
How to send an e-mail without using the MFMailComposeViewcontroller
implement a SMTP client in your app.
MFMailComposeViewController
can't be automated, limited in any way or changed later.
I don't want apps that send spam mails to all my contacts, and apple thought about this too.
Related Topics
Pull Notification Locally on Jailbroken Device
Track Cellular Data Usage Using Swift
Remote Image Size Without Downloading
Perform Action by Clicking on Some Word in Uitextview or Uilabel
Enable Uialertaction of Uialertcontroller Only After Input Is Validated
iOS 7 When Rotating View in Tab Bar, Right Side of View Is Not Clickable
Uploads Using Backgroundsessionconfiguration and Nsurlsessionuploadtask Cause App to Crash
Swift Error: Editor Placeholder in Source File
iOS Simulator Is Not Launching
Swift String Escaping When Serializing to JSON Using Codable
Locking Orientation Does Not Work on iPad iOS 8 Swift Xcode 6.2
Filter Array by First Letter of String Property
How to Get All Available Wifi Network Name Listings in iOS
How to Get 18-Digit Current Timestamp in Swift
Apple Push Notification Service Server Certificate Update
Uibutton with Single Press and Long Press Events Swift
Swipe Left or Right to Load the View Controller with the Collection View Cell Highlight