EasyMailSender 0.0.2

EasyMailSender 0.0.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Oct 2015

Maintained by azu, akuraru.



  • By
  • azu

Easy to send e-mail by MFMailComposeViewController.

You don't worry about MFMailComposeViewControllerDelegate, can write with block.

Installation

pod 'EasyMailSender'

Usage

  1. Setup MFMailComposeViewController
  2. Call showFromViewController:
- (IBAction)handleMailButton:(id) sender {
    NSString *attachedText = @"text";
    EasyMailAlertSender *mailSender = [EasyMailAlertSender easyMail:^(MFMailComposeViewController *controller) {
        // Setup
        [controller addAttachmentData:[attachedText dataUsingEncoding:NSUTF8StringEncoding] mimeType:@"plain/text" fileName:@"test.txt"];
    } complete:^(MFMailComposeViewController *controller, MFMailComposeResult result, NSError *error) {
        // When Sent/Cancel - MFMailComposeViewControllerDelegate action
        [controller dismissViewControllerAnimated:YES completion:nil];
    }];
    [mailSender showFromViewController:self];
}

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT