How to send S/MIME encrypted mails from iOS with attachment? - ios

How can I programmatically send an e-mail that is encrypted and signed using S/MIME?
How I currently do it:
Prepare MFMailComposer
Save the mail as a draft
Switch to native mail app
Open said draft
Send draft (which is automatically encrypted/signed by opening it directly from the mail app)
This seems unproductive.
Why I want MFMailComposer: If internet is unavailable, mail will be put in the outbox and sent automatically as soon as internet is available. If there is a solution to my S/MIME problem that doesn't rely on MFMailComposer, it has to have this "automatic-send"-feature.

Apple does not allow you to sent emails without MFMailComposer (because it would be easy to abuse).
The only way I can think of is to send your email to your sever and and encrypt it there/send it. You can always check if there is no intenet connection and write the contents of the email to a temp file and send it when internet is available.
Hope this helps.
Regards.

Related

How to programmatically read a mail message in iOS?

I'm planning a new iOS application (MApp) which should be able to process selected mail messages from the iOS Mail client.
The desired flow is as following:
- Open the iOS mail
- Select a specific message
- "Send" it to the discussed MApp
- Get processed mail results from MApp
The only API related to emails I have found for iOS is MFMailComposeViewController but that's the other way arround.
Is there an API in iOS to allow accessing (interactively, bound to user permission) a single mail message ?
There isn't. The only way to actually get access to certain emails is to go through the email provider such as Gmail / Outlook and develop an app that interacts directly with the inbox. POP3 or something similar is also possible, but you have no easy way to actually get to the mail content itself.

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.)

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!

Fetch and Send email in iPad app programmatically

What I want is to allow user to send and receive mail from my iPad app. I know that I can user MFMAilComposer but it's for sending only as per my requirement I need to provide all functionaly of an iPad email client app.
As far as I know you can send email using your iPhone app either using background or using the POP3/SMTP see the following link.
Open Source Cocoa/Cocoa-Touch POP3/SMTP library?
However, You can not get the emails received in iPhone mail box. But I think you can receive email from your mail server...See this stack overflow link you will get more idea Can receive mail directly from mail server in custom iPhone app?
Hope my answer helps..

Possible to send automated email?

The iOS SDK class MFMailComposeViewController can be used to let the user compose an email message.
What I'd like to do, is for the iOS app to send an email in the background, with no user interaction. Is this at all possible/allowed in the iOS SDK?
Nope. There isn't any API available to do this. You'd need to roll your own SMTP client and have the user enter credentials into your application. On top of that Apple may not approve this.
Unfortunately, I don't think Apple would ever allow this because (for example) then you could just get everyone's email address by auto-sending mail to yourself. :(
I actually wanted to implement something like this for the express purpose of alerting me when a critical error happens on an app in the app market.
Best solution would be to create an API (just ping a php file or something), and have it send the relative alert message to your email).

Resources