BZGMailgunEmailValidation 1.1.1

BZGMailgunEmailValidation 1.1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Ben Guo.



  • By
  • Ben Guo

A simple objective-C wrapper for the Mailgun email validation API.

BZGMailgunEmailValidator *validator = 
    [BZGMailgunEmailValidator validatorWithPublicKey:YOUR_PUBLIC_KEY];

[validator validateEmailAddress:self.emailFieldCell.textField.text
                        success:^(BOOL isValid, NSString *didYouMean) {
                        // Validation succeeded
                      } failure:^(NSError *error) {
                        // Validation failed
                      }];

Notes

  • By default, a BZGMailgunEmailValidator instance performs fallback regex-based validation if Mailgun validation fails. Set performsFallbackValidation to NO if you'd prefer to handle this case yourself.
  • Caveat implementor: success and failure blocks are executed on the main queue.

Installation

If you're using Cocoapods, simply add pod 'BZGMailgunEmailValidation' to your Podfile.

Otherwise, add BZGMailgunEmailValidator.h and BZGMailgunEmailValidator.m to your project.

References

http://blog.mailgun.com/post/free-email-validation-api-for-web-forms/

http://documentation.mailgun.com/api-email-validation.html

Roadmap