ios - how can i cause a MFMailComposeResultFailed error -
i want test behaviour made when email sending failed, can't mfmailcomposeresultfailed error. when there no internet connection, still "sends" email. how can done?
this not possible, hence kind of "errors" not delivered delegate. make sense, because "mail" takes care of sending or queuing mails.
from docs (mfmailcomposeviewcontroller
)
using interface not guarantee immediate delivery of corresponding email message. user may cancel creation of message, , if user choose send message, message queued in mail application outbox. allows generate emails in situations user not have network access, such in airplane mode. interface not provide way verify whether emails sent.
you check internet connection before displaying mfmailcomposeviewcontroller
. technical possible not recommended. mail
automatically send mail if device connected internet again.
but have to check if device configured send mail:
if ([mfmailcomposeviewcontroller cansendmail]){ //show mfmailcomposeviewcontroller }else{ //show alertview }
before using class, must check see if current device configured send email @ using cansendmail method. if user’s device not set delivery of email, can notify user or disable email dispatch features in application. should not attempt use interface if cansendmail method returns no.
Comments
Post a Comment