Why is MFMailComposeViewController not sending messages?

I am trying to send an email using xcode on a Mac PC. For this, I use the MFMailComposeViewController class, and I added the code files:

But when I click the submit button of the modal view controller, it returns an MFMailComposeResultSent object of the MFMailComposeResult class, but the letter did not reach the specified email identifier. When I click the Cancel button, it returns MFMailComposeResultCancelled.

And I also set up my mac with an email account. But I can’t understand how this email account is related to the above code, because even if I delete all the email accounts from the Mac, and then click the send modalViewController button, it returns an MFMailComposeResultSent object.

Can someone help me in sending an email and understanding the relationship between email accounts and the above code.

Thanks in advance.

+3
source share
1 answer

You do this in the simulator or on the device itself. MFMailComposeViewController does not actually send mail from the simulator.

+11
source

Source: https://habr.com/ru/post/1724009/


All Articles