Failed on using Swift to implement in-app email

前端 未结 3 2123
走了就别回头了
走了就别回头了 2021-02-14 08:52

I want to use swift to implement in-app email. When I click the button, the email window pops up. However, I am unable to send my email. Moreover, after I click cancel-delete dr

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-14 09:26

    Since you haven't set the current view controller as the mailComposeDelegate of myMail, the mailComposeController:didFinishWithResult method isn't being called. After you init myMail, make sure to add:

    myMail.mailComposeDelegate = self
    

    and you'll be good to go

提交回复
热议问题