I have a problem in MFMailComposeViewController.
if no one login in mail and i try to open this view, app crashes
how to solve this?
if i login frommail in ipad and after that i try to load this its working fine.
Thanks,
Shyam Parmar
As far as I know the MFMailComposer requires a mail account in-order to send mail so if an account is not set up it will cause problems. you can check if the mfmailcomposer can send mail through its method [MFMailComposeViewController canSendMail];
Related
I am developing an iPhone application in which I have to send mail to only recipient without showing the MFMailComposer UI view (i.e without user interaction). 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 also use the gmail mail facilities into the xcode
For that following to gives much more tutorial and source code here
Reference link
Using openURL method of UIApplication, you can send the mail without using mail composer. For that you should select "mailto" option.
i am creating an application where user will find the deal and if he want to receive the deal detail by sms or email.
how user will get sms and mail from my application without using web service if any sample code is available then please help me.
Thanks in Advance
For mail you can check out this: MFMailComposeViewController and its delegate MFMailComposeViewControllerDelegate.
Documentation here:
https://developer.apple.com/library/ios/#documentation/MessageUI/Reference/MFMailComposeViewController_class/Reference/Reference.html
For sending SMS, MFMessageComposeViewController.
Documentation here:
https://developer.apple.com/library/ios/#documentation/MessageUI/Reference/MFMessageComposeViewController_class/Reference/Reference.html
Apple provides MFMessageComposeViewController which can be used to send SMS too. This article should solve your problem - How to Send an SMS Progammatically in iOS
i want to send mail through iphone sdk i know there are lots of answers here on stack overflow but it does not work ,i downloaded the mail composer app from apple site and ran in my simulator ,it displaye that mail has been sent but i dont get it on my email address
YOU CANNOT send mails through simulator. It just shows mail sent for the acknowledgement that your mail code is working and wont crash or have any errors..
For testing you have to use device. SIMULATOR shows you the composer but will never send mail as the mailclient is not installed in it..
hAPPY cODING...
You cannot test mail and message compose controllers in simulator. Mail composer uses the default mail account set up on your device to send the mail. There is no mail account set up in the simulator.
Test it on device...
Hee
Does anybody know how to check in-application if a mail account is setup on the device?
Thanks
You can call [MFMailComposeViewController canSendMail] to check if there's any mail accounts available for sending mail.
I am tring to send an email using xcode on Mac PC. For this I am using MFMailComposeViewController class and I have attached the code files:
But when I click on send button of the modal view controller then it returns MFMailComposeResultSent object of MFMailComposeResult class but the email did not reach to the specified email id. When I click on Cancel button then it returns MFMailComposeResultCancelled.
And I have also configured my mac with an email account. But the thing which I am not able to understand is How this email account is connected with the above code because even if when I delete all the email accounts from the mac machine then also on clicking the send button of the modalViewController it returns the MFMailComposeResultSent object.
Can someone help me in sending the email and understanding the communication between the email accounts and the above code.
Thanks in advance.
Are you doing this in the simulator, or on an actual device. MFMailComposeViewController doesn't actually send mail from the simulator.