Latest 0.2
Homepage https://github.com/dkasper/Mailcheck-ObjectiveC
License MIT
Platforms ios 6.0, requires ARC
Dependencies NSString-Email
Authors

Mailcheck – Objective-C

The Objective-C library that suggests a right domain when your users misspell it in an email address. See the original at https://github.com/mailcheck/mailcheck.

When your user types in "[email protected]", Mailcheck will suggest "[email protected]".

Mailcheck will offer up suggestions for top level domains too, and suggest ".com" when a user types in "[email protected]".

Usage

Copy mailcheck.h and mailcheck.m from the Mailcheck folder to your project.

#import "Mailcheck.h"
NSDictionary *result = [Mailcheck suggest:@"[email protected]"]

Result will contain nil if the domain appears to be valid.
Otherwise the suggestion will be a dictionary like this:

{@"address": @"test",
 @"domain":  @"hotmail.com",
 @"full":    @"[email protected]"}

New in 0.2

Now includes a check if the email is valid thanks to https://github.com/NZN/NSString-Email

#import "Mailcheck.h"
NSDictionary *result = [Mailcheck check:@"[email protected]"]

Result will contain keys for "valid" and "suggestion"

{@"valid": @(YES),
 @"suggestion": {@"address": @"test",
                 @"domain":  @"hotmail.com",
                 @"full":    @"[email protected]"}}

Supply your own domain lists:

NSDictionary *result = [Mailcheck check:@"[email protected]" domains:@[@"mydomain.co"] topLevelDomains:@[@"co"]];

Or add to the default list:

NSDictionary *result = [Mailcheck check:@"[email protected]" extraDomains:@[@"mydomain.co"] extraTopLevelDomains:@[@"co"]];

Check the MailcheckDemo or the GHUnit tests in TestMailcheck.m for more usage examples. You can run the tests by loading the demo project and selecting the Tests scheme.

Maintainers

License

Licensed under the MIT License.

Latest podspec

{
    "name": "Mailcheck-ObjectiveC",
    "version": "0.2",
    "summary": "An Objective-C port of Kicksend's Mailcheck. Suggest corrections for misspelled email addresses.",
    "homepage": "https://github.com/dkasper/Mailcheck-ObjectiveC",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "David Kasper": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dkasper/Mailcheck-ObjectiveC.git",
        "tag": "0.2"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "Mailcheck/*.{h,m}",
    "requires_arc": true,
    "dependencies": {
        "NSString-Email": []
    }
}

Pin It on Pinterest

Share This