Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't MFMailComposeViewController send messages?

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.

like image 302
Gaurav Arora Avatar asked Dec 08 '25 10:12

Gaurav Arora


1 Answers

Are you doing this in the simulator, or on an actual device. MFMailComposeViewController doesn't actually send mail from the simulator.

like image 117
Ben Gottlieb Avatar answered Dec 09 '25 23:12

Ben Gottlieb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!