SMTPLite 0.0.3

SMTPLite 0.0.3

测试已测试
语言语言 Obj-CObjective C
许可证 BSD
发布最新发布2015年11月

黄嘉森维护。



SMTPLite 0.0.3

  • jasenhuang

smtp

1.精巧的 Objective-C SMTP 库

2.基于 libcurl-7.44

pod 'SMTPLite', '~> 0.0.3'

    SMTPMessage *message = [[SMTPMessage alloc] init];
    message.from = @"[email protected]";
    message.to = @"[email protected]";
    message.host = @"smtp.domain.com";
    message.account = @"[email protected]";
    message.pwd = @"***";

    message.subject = @"from jasenhuang";
    message.content = @"this is a html!<br/>not plain text<br/>";
    SMTPAttachment* attach = [[SMTPAttachment alloc] init];
    attach.name = @"image.png";
    attach.filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"image" ofType:@"png"];
    message.attachments = @[attach];

    [message send:^(SMTPMessage * message, double now, double total) {

    } success:^(SMTPMessage * message) {
        NSLog(@"response = %@", [[NSString alloc] initWithData:message.response encoding:NSUTF8StringEncoding]);
    } failure:^(SMTPMessage * message, NSError * error) {
        NSLog(@"error = %@", error);
    }];