Validate an email address by using Mailgun API
- Mailbox detection
- Syntax checks (RFC defined grammar)
- DNS validation
- Spell checks
- Email Service Provider (ESP) specific local-part grammar (if available)
To use it, you need to sign up for a Mailgun account and get a free API key.
The following piece of code is the starting point to use the Mailgun plugin:
The sample code above assumes that the FormValidation files are placed inside the
vendors directory. You might need to change the path depending on where you place them on the server.
| ||String||The API key provided by Mailgun|
| ||String||The field name that will be validated|
| ||String||Error message indicates the input is not valid|
| ||Boolean||Show suggestion if the email is not valid. By default, it is set to |
You can use the following sample email addresses to test with your app.
|Does not meet Gmail minimum local-part length of 6 email@example.com|
|Invalid, because gmaill.com does not have valid MX firstname.lastname@example.org|
|Invalid because while microsoft.io does not have any MX records, it does have fallback A records, but alas no Mail Exchanger email@example.com|
|Meets Gmail 6 character minimum and all other firstname.lastname@example.org|
|Meets pure syntax checks||"hello world"@domain.com|
|Suggest new email email@example.com|
The following sample code demonstrates how to use Mailgun plugin to validate email address which its form is made with Tachyons:
- v1.0.0: First release
The following validators might be useful to you.