The process of verifying an email address is called Email Verification. Verification improves the odds that email belongs to a real person. The primary purpose of email verification is to guarantee that a real person will receive all your sent emails.
How can we verify email in 1C? We can do it with different email verification web services. For example, let’s use https://debounce.io/ service. The opportunity to try for free how it will work the main advantage of this service. The first 100 calls are free.
The first step is to register the debounce.io. You can do it the same way as always.

The next step is to receive your debounce.io API key.
Once you have received the API key, you can open 1C and start writing code.
Let’s add the constant, where we will store the API key:
Add the Common form on which this constant will be located:
Please, add one Enumeration with four values: SaveToSend, Invalid, Risky, Unknown – they are will be as verification answers from the debounce.io
Then we add one Catalog “Clients” with two attributes “Email” (string) and “EmailVerifying” (Enums.EmailVerifying), the Item form for it.
We rename the “Description” field to “Full Name”- to be clear for understanding that we will store here. Also, the “Email verifying” field we make as Unenabled, we don’t need the opportunity the users to change this field. Here is we will store the debounce.io answer for our request.
We add the new command VerifyEmail, “Create on a client” action and via drag-and-drop, we make a “Verify email” button.

Well - now let’s move on to the 1C source code.
At first, we create VerifyEmail() procedure. Here is we make a request to debounce.io, receive the verifying answer, and put it into the “Email verifying” field.
&AtClient
Procedure VerifyEmail(Command)
// Insert handler content.
Token = getApiKey();
If Not ValueIsFilled(Token) Then
Message("Please, fill the Constant: Debounce Api Key");
Return;
EndIf;
sEmail = Object.Email;
if (sEmail <> "") then
Host = "api.debounce.io";
HTTPRequest = New HTTPRequest;
HTTPRequest.ResourceAddress = "v1/?api=" + Token + "&email=" + sEmail+"&photo=true";
HTTPConnection = New HTTPConnection(host,,,,,10,New OpenSSLSecureConnection);
HTTPAnswer = HTTPConnection.Get(HTTPRequest);
stringAnswer= HTTPAnswer.GetBodyAsString();
JSONReader = New JSONReader;
JSONReader.SetString(stringAnswer);
JsonResult = ReadJson(JSONReader,True);
For each strResult in JsonResult Do
If (strResult.Key = "debounce") Then
For each strDebounce in strResult.Value Do
If (strDebounce.Key = "result") Then
Object.EmailVerifying = SetupEmailVerifying(strDebounce.Value);
EndIf;
EndDo;
EndIf;
EndDo;
Else
Message("Please, fill the Email field");
EndIf;
EndProcedure
&AtServer
Function SetupEmailVerifying(EmailVerifyingValue)
If (EmailVerifyingValue = "Safe to Send") Then
Object.EmailVerifying = Enums.EmailVerifying.SafeToSend;
ElsIf (EmailVerifyingValue = "Invalid") Then
Object.EmailVerifying = Enums.EmailVerifying.Invalid;
ElsIf (EmailVerifyingValue = "Risky") Then
Object.EmailVerifying = Enums.EmailVerifying.Risky;
ElsIf (EmailVerifyingValue = "Unknown") Then
Object.EmailVerifying = Enums.EmailVerifying.Unknown;
EndIf;
EndFunction
GetApiKey() procedure returns us the debounce.io API key from the Constants.
&AtServer
Function GetApiKey()
Return Constants.DebounceAPIKey.Get();
EndFunction
EmailOnChange() procedure sets up the “Email verifying” field = “Not Verified” as default after email changing.
&AtClient
Procedure EmailOnChange(Item)
Object.EmailVerifying = "Not Verified";
EndProcedure
That is all, let’s save and update our configuration and see how the Email Verification will work at our 1C system.
Run the 1C in 1C:Enterprise mode, open Tools->Debounce API Key, and put in the “Debounce API Key” field the API key we received at the beginning.
Create a new Client item and fill all information. After Email filling, you will see “Not Verified” as email verifying information.
Push the “Verify Email” button. You will receive “Invalid” if an email doesn’t exist.
And “Save to Send” if the email exists
You can download this Example for your own application.
If you have any questions about this article, you can always get answers on our forum: https://1c-dn.com/forum/
Stay with us!