Skip to content

Commit

Permalink
Added README
Browse files Browse the repository at this point in the history
  • Loading branch information
belidzs committed Apr 28, 2018
1 parent 9a66c39 commit d9c8764
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# MailgunAddressValidator - an e-mail validation library

[![Build status](https://ci.appveyor.com/api/projects/status/ltaecen2djcjlxhl?svg=true)](https://ci.appveyor.com/project/belidzs/mailgunaddressvalidator)

**Important:** To use this library, you need to sign up at https://www.mailgun.com and get a public API key. The first 100 validation is free each month.

*Note:* I'm not in any way affiliated or endorsed by Mailgun.

## Running tests with NUnit

If you want to run NUnit tests, you need to rename `app.config.example` to `app.config` and set `PublicApiKey` to your public API key. It should look like this: `pubkey-xxxxxxxxxxxxxxxxxxxxxxxx`

## Usage

Add NuGet package to your project, then simply start validating:

```c#
using MailgunAddressValidator;

namespace MailgunAddressValidatorTests
{
public class MailgunAddressValidatorTests
{
private string apikey = "pubkey-xxxxxxxxxxxxxxxxxxxxxxx";

public void ValidateValidAddress()
{
ValidationResult result = Validator.Validate("foo@mailgun.org", apikey);
MessageBox.Show(String.Format("Validation result: {0}", result.IsValid));
}

public void ValidateAddressWithTypo()
{
ValidationResult result = Validator.Validate("test@gmaill.com", apikey);
MessageBox.Show(String.Format("Validation result: {0}\nDid you mean the following? {1}", result.IsValid, result.DidYouMean);
}
}
}
```

## API documentation

You can find the official API documentation here: https://documentation.mailgun.com/en/latest/api-email-validation.html

0 comments on commit d9c8764

Please sign in to comment.