troyz / MailUtil

Sending mails with `skpsmtpmessage` in serial order.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MailUtil

[![CI Status](http://img.shields.io/travis/Troy Zhang/MailUtil.svg?style=flat)](https://travis-ci.org/Troy Zhang/MailUtil) Version License Platform

Introduction

As you known, skpsmtpmessage could not send email in concurrent order. MailUtil is a tool that wrap skpsmtpmessage to send emails in serial order. Thanks for the article Sending Mails in Serial Order using GCD.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS7+

Installation

MailUtil is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MailUtil", :git => 'https://github.com/troyz/MailUtil.git', :tag => '0.1.0'

Useage

// please correct it.
[SendEmailOperation setupConfigWithServer:@"smtp.163.com" withFrom:@"java-koma@163.com" withLogin:@"java-koma@163.com" withPassword:@"**********"];

// the attachment file path
NSString *path = [[NSBundle mainBundle] pathForResource:@"ticket@2x.png" ofType:nil];

// a message that will be sent
SendEmailOperation *operation = [[SendEmailOperation alloc] initWithTo:@"java-koma@163.com" subject:@"Hello" body:@"World" path:path];

// send the message
[SendEmailOperation sendEmail:operation];

Author

Troy Zhang, java.koma@gmail.com

License

MailUtil is available under the MIT license. See the LICENSE file for more info.

About

Sending mails with `skpsmtpmessage` in serial order.

License:MIT License


Languages

Language:Objective-C 78.8%Language:Shell 16.1%Language:Ruby 2.2%Language:C 1.6%Language:HTML 1.4%