restrict sending mail from gmail/yahoo in ipad - ipad

I am designing an application for a society.
In this application, there is a feature to send the contents of the particular page via mail by clicking of a button. There is no custom mail app designed. The feature uses iPad's native mail app to send the mail.
I want to restrict the user to send the mail only from the society's domain registered mail account and not from his/her personal gmail/yahoo/msn id.
How do I put this restriction from my app?
Thanks in advance

I suggest you send the email from your server, as you won't (and shouldn't) be able to control the user's email app. In other words, you allow the user to enter one or more email addresses into your app and then put the contents of the page into an email that you send from your email server to the specified addresses.

Related

How to send email in swift without the user having to press send?

Know a user can send a mail using he MFMailComposeViewControllerDelegate as mentioned here, but how to send a conformation mail to the user after the set of specific task has been done.
For some reason it feels like apple doesn't allow in sending background mails, without user conformation, which is fine.
The task is to send a conformation mail like after you buy productA, productB and pay, need to send a receipt to the said mail id.
Any guide in the said path would be greatly appericiated
You can't send an email from the user's email address without using an MFMailComposeViewController, and you can't send an email to the user without the use of a server.
What you should do is prompt the user to enter their email address, send that as part as their purchase, and then use a server-side mail app to send a confirmation email to the user-provided email address.
You can't send it directly from users device without email composer.
Only way to do this will be to prepare your own server that will handle those events and send proper emails from server side.

How to change the From address mail id dynamically using mail composer in iOS

My application has the option to log in with google account.
So by using that corresponding login email id, I need to share content through that particular email using MFMailComposeViewController method.
There isn't a way to do what you want with the From field. The from address will default to mail account the user has specified as "default" in Settings. i.e iPhone/iPad devices' "Mail". And MFMailComposeViewController is used to send mail with that mail account, not the mail address you used to login your app.

Open suggestion of all installed email clients to user

I have a use case to send email to external users from my app.
We want to show all installed email clients when user clicks on send mail which open the user opted mail client with pre filled fields.
How can I achieve this?
Ex : it is like when user clicks on share button of image in gallery, we will show all apps which supports file sharing.
Perhaps the UIActivityViewController is what you're looking for?
http://nshipster.com/uiactivityviewcontroller/

Is there any way to send the email without opening the MFMailComposeViewController?

I need to send the email without opening the MFMailCompseViewController. I have searched about this and got some point like use the web service and another one is connect with gmail server through ask the emailID and password from the user.
My email format is fixed i just have to send the email to user whose id will be given by the user without showing any thing else.
Your existing research is accurate - you can connect to some web service to send the e-mail automatically, but you can't automatically create, configure and send using MFMailComposeViewController. The user always gets to see the presented controller and choose whether to do any editing and whether to send or not.
There is no way of sending an email directly from iDevice without showing the MFMailComposeViewController.
If it was possible it would be a great tool for mobile distributed spam bots.
Things to consider: MFMailCompseViewController is an interface for the user to compose an email.
If you want to use it, you have to hand over control to it. Apple does not expose the underlying functionality to you: it has to go through this view controller.
If you don't want the user to be aware that you are sending emails on their behalf (I assume it is on their behalf or you wouldn't need the composer view) you are probable doing things a little wrong; why would you want to send an unsolicited email?
If you want to report information from the device, implement a web service and send it to that. Email is meant for correspondence; don't hijack an account.
If you still need an email, have the web service create it

Form submission in iOS app?

Im really new to iOS development, but I have some experience in OSX. I am trying to make an app where the users fills out text fields with information and then presses a submit button. The contents of the fields that they filled out are then automatically sent to me via an email.
I built a similar OSX application that could do this, but I cannot figure out how to do it on iOS.
I do not want to use the MessageUI.framework because, as far as I can tell, the user must press the send button after it brings up the email form. I just want it to send in the background.
I have no problem hardcoding in the email address and password, or using the same email for send and receive. ex: to: me#gmail.com from: me#gmail.com
Any pointers would be sweet!
You have two options if you do not want to show the mail composer window to the user
Use an SMTP Client for iOS like this one and send the email from your app with the email id and password hard-coded in the app. But if you want to change the email id or change the password in the future, you'll need to update the app. So this is a less desirable solution
Create a web script on your server which accepts the form fields to be submitted by the user. Then from this web script, send the email to your email id (for instance, if you use a PHP script, use the mail function to send the email). Call this script in the app using NSURLConnection.
You are going to need to make a custom form and then send all of the fields in the form as POST parameters to a custom API that you make on some server. Then you can just redirect that as an email to yourself through something like SMTP

Resources