Email.Verify
------------

Verifies if an email is valid.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Utility](component_Utility.md) [SendMail](component_SendMail.md) | [3.3](newinversion33.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Email.Verify"; emailAddress; Flags ) 

**MBS**( **"Email.Verify";** /\* Verifies if an email is valid. \*/  
**$emailAddress**; /\* The email address to check.e.g. "hello@macsw.de" \*/   
**$Flags**) /\* The sum of the flags to use.  
Add 1 to check via DNS if domain is valid for email.   
Add 2 to return the name of the mail server domain.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| emailAddress | The email address to check. | "hello@macsw.de" |
| Flags | The sum of the flags to use.   Add 1 to check via DNS if domain is valid for email.    Add 2 to return the name of the mail server domain. | 0 |

### Result

Returns OK or error message.

### Description

Verifies if an email is valid.  
Check syntax of email and optionally verifies if domain is registered for email delivery.  
The network check may take a few seconds. While the function returns normally after a few milliseconds, the DNS server may not always be reachable and then the DNS query is sent several times.  
For DNS query to work, firewall must allow port 53 to be used to connect to DNS server.  
  
You can send or receive emails with our [CURL](component_CURL.md) functions. For sending the [SendMail](component_SendMail.md) functions help to build an email and send it, while [EmailParser](component_EmailParser.md) functions help to parse an email.  
  
If you have a DNS server, which will redirect all mistyped domain names to a search website, this won’t really work well and detect too many valid domain names.  
  
Does not work for IDN domains, e.g. with umlauts. You need to transcode them to puny code yourself.  
### Examples

Checks an Email:

 MBS ("Email.Verify"; "Hello@macsw.de"; 1)  
Query mail server for monkeybreadsoftware.com:

 MBS ("Email.Verify"; "test@monkeybreadsoftware.com"; 2)  
<small>  
Example result: "mxlb.ispgateway.de"</small>### Release notes

- **Version 10.4**
    - Changed [Email.Verify](https://www.mbsplugins.eu/EmailVerify.shtml) to have flags as second parameter. We keep 1 for network check and add 2 as an option to return the name of the mail server domain.

### Blog Entries

- [MBS FileMaker Plugin, version 10.4pr1](https://www.mbsplugins.de/archive/2020-07-28/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 3.3 for OS X/Windows - More than 1600 Functions In One Plugin](https://www.mbsplugins.de/archive/2013-07-24/MBS_FileMaker_Plugin_33_for_OS/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.3pr3](https://www.mbsplugins.de/archive/2013-06-02/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 2/2022, Seite 19](https://filemaker-magazin.de/neuigkeit/4174-Appetithappen-FMM_202202)

This function is free to use.

Created 18th August 2014 , last changed 4th March 2023

  
[EIDSDK.Version](EIDSDKVersion.md) - [EmailParser.Address](EmailParserAddress.md)

[HTML Version](EmailVerify.shtml)