Sunday, 12 June 2016

How to send email in swift

import foundation
import socail
import messaging
let mailComposerVC = MFMailComposeViewController()

mailComposerVC.mailComposeDelegate = self // Extremely important to set the --

mailComposeDelegate-- property, NOT the --delegate--
mailComposerVC.setToRecipients(["someone@somewhere.com"])

mailComposerVC.setSubject("Sending you an in-app e-mail...")

mailComposerVC.setMessageBody("Sending e-mail in-app is not so bad!", isHTML: false) just copy pase this code in button action and and check out put

No comments:

Post a Comment