Ok, so I have successfully made my first in-app Email app using MFMAilComposer. I have the toRecipients textfield added, as well as subject and body etc. So I understand that the email will not send if I use the simulator and will send with an iPhone. However, when a person receives the email, how is that person supposed to know whom he received it from? With this in mind, a "From" field should be in order. I appreciate all answers, and thanks in advance :)
You don't have to handle this, the mail composer does it for you. When the composer is shown it defaults to the users default email account but if they want to choose which email address they are sending from they can simply tap their email and a list will expand allowing them to choose from which of their emails to send the message.
Related
First of all, I'm working on an in-house app, so I don't need approval at App Store. I know it wouldn't ever be accepted, but it's a business rule our users share some content of the application, but with a default message and subject, so they can't edit these fields..
Until iOS 5 I was able to navigate by the view hierarchy and let the fields unneditable. But with iOS 6, and the mail on another proccess, I can't do it anymore.
I need to block the views for editing (I put a view over all the mail view, except the title bar, and it works, but when the user try to cancel the e-mail, my view is blocking the popover to delete or save draft too) or send e-mails without the UI (I was able to do it with Stealth Messenger based code (https://github.com/0xced/Stealth-Messenger/) at iOS 4 or 5, but now it doesn't work).
I tryed everything I could with private APIs and Objective-C runtime.. I can dismiss the view with sending e-mail ok, but the e-mail itself isn't sent.
Can anybody help me? Does anybody did it?
Thanks in advance..
Take a look at this: Send Email in Background from iOS
IOS doesn't support to mail in background. [...] As an alternate you
should implement the WebService for this[...]
Probably the best option is to utilise some server code and call that with NSURLRequest.
Hope that helps.
I do this in an app of mine. I have a simple PHP script on a webserver that uses the PearPHP mail modules to send SMTP mail. The PHP script takes a few incoming variables, like $toAddress, $subject, $message and then connects to the SMTP server and sends the mail out.
Unfortunately, you're not allowed to subclass the MFMailComposeViewController, and if you were using some sort of Invisible UIView to block fields, that was just a workaround that's probably been broken. (They did the same thing with being able to insert a "." on the NumberPad keyboard)
I need to Create an iPad application for sending the selected photo as an attachment in an email.
The TO and CC address can be typed or must be able to select from contacts if they have email address added.
As I am a new guy in iPhone/iPad application can any one provide me a good way to do it. Any sample apps, paths to refer.
I recommend you take a look at MFMailComposeViewController in the documentation. The examples there will help. You'll want to include the MessageUI.framework as well. This should get you going with mailing within an app.
For the picture side, check out UIImagePickerControllerDelegate.
i want to show user from which account he is going to send email when he is going to send an email using my app and i am using MFMailComposeViewController. so what is the way of getting the from email address.
There is no way to get this information. Mail sent via MFMailComposeViewController is always sent from the user's default address.
Mail sent via MFMailComposeViewController is always sent from the user's default address.
User's default address is selected by default but the user can switch the accounts. Anyway, no way to get this info back into your app.
I have a question about the MFMailComposeViewController for sending an Email in an app. Is it possible to check the recipient adress before sending the email ?
I did not find any response so i think it's not possible..
If it's not possible, there is other solution ?
When you present the MFMailComposeViewController you lose complete control over it.
You can't do anything with it, neither get the "To" email address nor prevent the sending of the mail.
From the documentation:
Important: 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. The user may still edit the content using the interface, but programmatic changes are ignored. Thus, you must set the values of content fields before presenting the interface.
I want to attach a video and send email from my application.
I downloaded apples example code MailComposer. I compiled it. I did not get any errors or warnings.
I sent the mail to my mail id. But, I could not see any mail in my inbox. I am working on simulator.
I did not set any senders email id in simulator.
How can I know whether the code is working or not ?
Thank You.
The simulator cannot send email; nor can all devices, as you'll discover if you use the MFMailComposeViewController +canSendMail method—it returns NO if the device doesn't have a mail account set up. To quote the documentation:
You should call this method before attempting to display the mail composition interface. If it returns NO, you must not display the mail composition interface.