Is it possible to have a custom view for MFMailComposeViewController? - iphone

I have a nicely designed mail sending page that I have to implement. I would like to use MFMailComposeViewController to achieve this task but this comes with its own regular view. What are my options? Is there a way to use my own view with MFMailComposeViewController? Or maybe another way to send emails from the app that allow me to customize the view?
Thanks!

You may not change MFMailComposeViewController in any way. Quoth the documentation:
Important: The mail composition interface itself is not customizable and must not be modified by your application.
As far as I know, there is no other built-in way to send email from the device.
Your only other option would be to have the device contact a server of your own which would forward the email message, but then of course the message wouldn't be coming from the email address associated with the device and such.

Anomie is correct.
We created an app which had used a backend email server to send anonymous emails and we had a custom front end to collect the user message. However if you're just thinking that the composition interface needs a makeover it's really not a good approach and almost certainly will get you slammed during the submission process.
Best Reason for not messing with the interface -
. User will question authenticity of any email interface which does not resemble Apple's email interface.

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

is it possible to send email with custom view instead of presentModalViewController

i need to send email in my application.
i know that this can be possible using MFMailComposeViewController.
But it popup presentModalViewController,I need to custom reception box,composer,subject like this.
simply by clicking send button i need to send email.
if it is possible can ant one please help me.
Thank u in advance.
For security and privacy reasons, Apple does not allow applications to send automatically email, and requires the user to review it and explicitly click on the Send button in order to do it.
If a regular app could present its own view to get the email data and send it, what's to stop a malicious app from sending spam emails on the user behalf to all his contacts?
Franci is right that Apple's frameworks do not allow this, but it can be done. You need to link in a custom SMTP framework to do it.
This is an example.
http://code.google.com/p/skpsmtpmessage/
I have not used that particular framework. Googling will probably provide many other options.
There's no background mail-sending class in Cocoa, but if you reallllly need to, you can build your own. A lot of mail servers will let you send mail anonymously. Read on up on the SMTP protocol, then pick a mail server and telnet into it and test it out. Then you can use network classes in Cocoa to follow the protocol programatically. It's a bit of a pain, but I've done it before.
Useful links:
NSStream
NSInpoutStream
NSOutputStream
SMTP protocol
To telnet into a server, pick a mail server, then in terminal, type telnet <server> 25 and press Enter. Then follow the protocol.

Can I send email programmatically in iPhone app?

I need to be able to send a pre-formatted email or SMS text message programmatically from within an iphone app. Can this be done? I have looked at apple's MFMailComposeViewController class, but this "provides a standard interface that manages the editing and sending an email message" and the MFMessageComposeViewController class also has it's own "standard system interface for composing SMS text messages". These allow you to present an interface to the user where they have to fill in all the data and then explicitly press a send button.
I cannot use this boilerplate functionality.
I need to be able to send a message without presenting any interface to the user. I know this sounds evil, but actually it is for a commercial application which needs to communicate to a user group in a central office when users in the field have performed specific actions out in the field.
Has anyone found a solution to this?
After much investigation, I have found that sending emails programmatically, without user intervention, from an iphone application, cannot be implemented using any of the apple frameworks.
Set up a web service 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).
Here are a few SMTP API's that work on OS X. They might work on iOS as well.
Pantomime
MailCore
EdMessage
Only Possible via Web Interface, you can not hide the Interface , this is as per apple Guidlines to Developer and as per documentation
Looking for a solution to such a problem, I found something interesting here: How to send mail from iphone app without showing MFMailComposeViewController?
I hope this will be useful!
This is standard not possible. If you can't use the standard dialog you need to use SMTP.
SMS is the same, use the dialog of use a webbased sms service (most of these cost some money).
I have no experience with iOS, but I have enough experience with email protocols to say I'd be very surprised if a client application could send email without accessing a server. More than likely, the email will be sent using the SMTP protocol and therefore must be sent using an SMTP server. Choosing how you connect to that server is about the only option you have. You could connect to a server-side script (such as php) to generate and send the email, or you may be able to create a socket and connect directly to port 25 on the SMTP server and still generate the email from you client application.
Check out:
RFC 5321 at https://www.rfc-editor.org/rfc/rfc5321
SMTP on Wikipedia at http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
You could always do a low level telnet using SMTP protocol to a known mail server to send a message. I don't know if Apple will reject the app, but SMTP is damned simple.

problem related email application

I want to send an email from my application whenever a user taps the SEND button of my view.I do not want to show the email interface to the user.All the fields needed for email will we filled via my application.So is there anyway to do this???
There is a project on Google Code called skpsmtpmessage which will allow you to send off a faceless email.
Alternatively you could have a look at the Pantomime package. It also contains implementations of the SMTP protocol. It has however not (yet) been ported to iPhone AFAIK, but since it's written in Cocoa it should not be that big a task for doing this specifically for the SMTP part..