How to send mail on click without present mfmailviewcontroller in iOS? - ios

I want to send my UILabel's text data as a message body to specified email address in text field .BT when I am trying to use MessageUI framework using mfmailviewcontroller delegate it will present its own view controller and after click on send button which is available in mfviewcontroller mail will be sent.
My requirement is to send mail directly on click of send button without Presenting mfmodel view controller screen.Can anyone please hep me for the same ?
.I searched for this BT not found any solution.

In iOS/apple framework doesnt allow application to directly send email without users explicite permission. so you Have to open the compose view controller.
To achive as like above you need to call web service in which web service will send email and you need to pass the email as the web params.

Related

How to send user input to designated e-mail?

I am developing an iOS app targeting iOS 9 and above using Swift 3 and xCode 8.
I have a "Contact ViewController" which contains multiple forms where user enters its data to submit. Collected data also contains users' e-mail address. I am validating all the information that entered by the user correctly.
So, what I would like to do is my "send" button to send the user's all data to an e-mail address.
Is this possible without using Mail App or its interface? Do I need additional framework for such functionality?
I appreciate your time and sharing your thoughts.
This is not possible secretly. You can't send an email from the users device via the Apple Mail app because the system will not allow that. You can prepare an email with all the data that opens and let the user send it to you by tapping "Send" in the NavigationBar. So yes, you would need another framework to do that.
But I would not use emails to do that. Just use a server you send the data to or a service like Firebase.
If you really have to send E-mails, and just pushing the data to a backend API is not enough:
This is not possible using built-in functionality, but you could leverage an external mail delivery service like Mailgun to send your mails. (From a security standpoint, this should be handled by a server and not by the app itself however.)

Send some data to contact from app (Objective-C, Swift)

Is there any way I can send some data to contact from contacts app? for example some string or integer? E.g. I have an app, when user open it the app shows all contacts from Contacts app. and when he tap one of the contact the app must send data to the persons phone. Must I do it with web service or there is any way to do it without web service?
P.S. sorry for my english!
There is no way to do this using built-in iOS libraries without invoking a UI. You can send an SMS message using the MFMessageComposeViewController class. That displays a UI to the user. If I remember correctly you can prepopulate the view with the content you want to send, but the user can edit it.
Likewise there is the MFMailComposeViewController for sending email, with or without attachments.
If you want to send data to another user without displaying a UI to the user you will need to either use a webservice or come up with your own system (involving a server you manage, a TCP socket connection between copies of your app running on both devices, or some other custom development)

How to send a mail without disclosing recipients mail id in ios

All I am developing an iPhone application in which I have to send mail to recipient without showing email id and the MFMailComposer UI view (i.e without user interaction and also user cant know who is the recipient). Can please tell me how to achieve this?
You cannot send Email without user acceptance. But there are a lot of web-services in internet which can send Email. I guess some app uses those services or uses own.
See also How can I send mail from an iPhone application
You can create a PHP webpage which uses the mail function, just a couple of lines of code.
Then just call the url to that php webpage from your app!

How do I access in my app content of email created in the app

I have created an iphone app that allows the user to send an email using MFMailComposeViewController. I know that when the email is sent a copy is kelp in the "Sent" emails of the email client. What I wanted to do was also save that data/information to a text file on the iphone (as a log file). I can't find how to access the email information (recipient, body, etc) so as to input into the text file. Can this be done?
Thanks in advance for your help
No it can't be done in that you can't access the user's emails.
Your app can log when you present a MFMailComposeViewController and what data your app filled it in with before it was presented to the user. But you won't know if they changed it.
You dont have access to the email text in MFMailComposer class. What you can do is, create a view to capture to, cc, subject and message and then launch MFMailComposer delegate and prepopulate all the captured data. The user still has to submit the mail and could change the text all together. The captured data can then be stored within the app.

Using MFMailComposeViewController without presenting the view controller

I am using MFMailComposeViewController to send an email with an attachment. In all the guides it chooses to present the view controller as a modal view so that the user can change the fields and choose to send or cancel.
I don't want people to be able to change the information that I have put in, so I was wondering if I could force it to send the email without going to the modal view?
I am aware of using a url with mailto but believe you can't add an attachment.
If anyone knows if this is possible or even better if they know how to do it I would really appreciate the assistance.
Many thanks.
No, you can't do this with MFMailComposeViewController. Apple is very specific in the docs that sending email is under the users control, not your apps. You are sending email from the users account, you can understand why access to the email is restricted I this way - a spambot would be trivial to make if this were not the case.
For the above reason I don't think you'd get an app which sends its own emails from the users account approved for the app store.
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.
See also: How can I send mail from an iPhone application?

Resources