How to send email from iOS apllication

Hello,

Does anybody know hot to send email from iOS application?

I tried to do it like this:

NSCharacterSet characterSet = NSCharacterSet.URLHostAllowedCharacterSet();
String emailString = NSString.alloc().initWithString("mailto:[email protected]=test")
.stringByAddingPercentEncodingWithAllowedCharacters(characterSet);

UIApplication.sharedApplication().openURL(NSURL.URLWithString(emailString));

But id doesn’t work. Nothing happens after this code is executed.

Hi!

Please see: https://www.appcoda.com/ios-programming-101-send-email-iphone-app/

and: https://stackoverflow.com/questions/1263412/send-mail-without-mfmailcomposeviewcontroller

Moe sample:
SendEmail.zip (87.0 KB)

Best Regards,
Roland