Custom email form in iPhone app? - iphone

Say I want to send email to my server, but I want the user to not see my address, or perhaps I want the subject to be preset. What if I want to email the value of a UISlider or other UI element without the user seeing the whole email view. How can I do that?
Must I use an Apple class, or can I use my own UITextFields?

The benefit of the Apple class is that you get the email address of the user. If you do not care about that, you can submit anything you want to your own server as POST data or by whatever means you wish. The interface can look like mail but the functionality will be like a web form.
If you need the address of the user and do not want to ask for it, then you will have to reveal the destination email address. You can specify a subject and body, but the user will be able to modify it.

Related

Sending email to hidden recipients from iOS app

Is there a way to send an email from my iOS application without showing the real email address of the recipient?
It would be better if I could hide it completely.
No - this isn't possible and makes little to no sense anyway. (See the existing MFMailComposeViewController and privacy - hiding the To: field? and How to customize MFMailComposeViewController so that i can make the "to" field as non-editable? questions/answers amongst others.)
Additionally as per the MFMailComposeViewController Class Reference docs:
Important: The view hierarchy of this class is private and you must
not modify it. You can, however, customize the appearance of an
instance by using the UIAppearance protocol. After presenting a mail
comopose view controller, your app cannot change the email content.
The user can edit the content of a presented instance but the system
ignores programmatic changes. If you want to set values for the
content fields, do so before presenting the interface.
However, there's nothing to stop you using a different SMTP client than the built-in one (https://github.com/jetseven/JSMailSender for example) or simply sending the relevant data (via your own app) to a server which then uses this to construct and transmit an email, although this obviously wouldn't have the iOS device's default "owner" email address or indeed any other details unless they were supplied within your app.
If you want to achieve this you can make a web service and send the recipient list to the web service and if the web service is made in php then it is easy to send an email using just a simple mail function in php. So in this way you can hide the recipients and send an email.

How to retrieve email address after the recipient click on a button inside email

I am working on a web apps with Asp.Net (C#) and I have a problem like this:
I will sent out an email for more than one person and there is a link in the email. If user click on the link I want to retrieve the email address of the respondent (as query string or whatever).
Is it possible?
How should I do?
Thanks in advance.
If you generate the emails dynamically, you can add a token to the url that is unique to each email address you send to. Your landing page will use the tokens to register a hit to a database.
On another note, please remember to handle information like email addresses with great care (i.e. securely), for example when storing them in a database.

Sending E-Mail on iPhone - A Better Approach (plus possible issues..)

I have this app which has an e-mail feature. When the e-mail window appears theres a recipient, subject and template text that asks for a few numbers and a name to be filled in to the gaps.
However I would like to approach this in a slightly better way. For example I would like a text box and a few drop down boxes in a view with a "Submit" button that, when pressed, would send an e-mail in the same format as above, but the required data would be filled in from the data the user has inputted via the drop-down menu/text box instead of having the user enter the information directly into an e-mail.
First of all, does Apple like this? I've heard they are not fans of sending e-mail in this way. (In the background).
Secondly, if Apple would approve of this, how would one go about implementing such a feature?
Thanks,
Jack
I can't speak to the policy issue, but there's no way for you to send a mail from the device (ie from the user's account) yourself without their UI.
If you want to accomplish this, you'll need your own server somewhere that you post the email messages to, and send on the back end from your own email account. This is probably not what you're after, but it would work.
If all you want to do is prepopulate some data in the email message, you can certainly give the user your picker controls, let them set it up, and then pop open the mail composer UI with all the message body pre-cooked. They'll still have to press "Send", but you can own the UI up until that point.

How to disable the TO address on compose email UI using MonoTouch?

I need to disable the TO address on compose mail UI. Because i used static email address. Also i don't want CC/Bcc address. How to remove CC/Bcc address on compose mail UI? I'm using MFMailComposeViewController for sending email.
I'm using MonoTouch. How to achieve this one?
You cannot do that, and there's a good reason.
Apple's approach to UI design is to make sure user is always in control.
If you present user with an email form, you should be prepared she might want to cancel and save it as a draft for later, add her other email address to CC, or even change To address if she really wants to.
The documentation for MFMailComposeViewController explicitly states:
The mail composition interface itself is not customizable and must not be modified by your application. In addition, after presenting the interface, your application is not allowed to make further changes to the email content.
To sum up, if you don't want user to be in control of target address, perhaps you should consider sending an email bypassing the MFMailComposeViewController UI.

how to add sender into an HTML coded email?

I need to send an email from my iPhone app but the name of the sender needs to be included within the body.
I do not know how to do that.
If you're using MFMailComposeViewController it takes the user's 'default' email account (as set up in Settings) and the email is sent from there. AFAIK, there's no way to obtain that email address (and the name that goes with it) programmatically.
But if your app can somehow get the user to associate their sender email account (via an addressbook picker) then you could use the standard AddressBook APIs to get the sender name and then insert that into the message.
[ It's not clear from your question if you're having problems with sending email, getting user names from contacts, or compositing HTML messages. Perhaps if you edited your question and explained what you're trying to do and what you've tried you'll get a better answer. ]