Sending an email from swift

import MessageUI
@IBAction func btnSendMail_Click(_ sender: Any) {
        
        let mailComposeViewController = configureMailComposer()
        if MFMailComposeViewController.canSendMail(){
            self.present(mailComposeViewController, animated: true, completion: nil)
        }else{
            print("Can't send email")
        }
    }
    
    func configureMailComposer() -> MFMailComposeViewController{
        let mailComposeVC = MFMailComposeViewController()
        mailComposeVC.mailComposeDelegate = self
        mailComposeVC.setToRecipients([self.lblMail.text!])
        mailComposeVC.setSubject("Contact Us")
        mailComposeVC.setMessageBody("", isHTML: false)
        return mailComposeVC
    }

MFMailComposeViewControllerDelegate Method

func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
        controller.dismiss(animated: true, completion: nil)
    }