Example of PHP code

Find here an example of PHP code you can generate in order to use our API service.
Read more information on How To Use API page and purchase a suitable subscription.
Check the single email address
                setUrl('https://www.emailmagnifier.com/api/v1.0/analizeemail');
                $request->setMethod(HTTP_METH_POST);

                $request->setHeaders(array(
                  'content-type' => 'application/json'
                ));

                $request->setBody("{
                  'Email': 'example@server.com',
                  'AnalyzeAllMXRecords': true,
                  'TestPosibility': true,
                  'AuthorizationKey': 'a1a1a1a1-b2b2-c3c3-d4d4-e5e5e5e5e5e5'
                }");

                try {
                  $response = $request->send();

                  echo $response->getBody();
                } catch (HttpException $ex) {
                  echo $ex;
                }
            
Check many email addresses
                setUrl('https://www.emailmagnifier.com/api/v1.0/analizeemails');
                $request->setMethod(HTTP_METH_POST);

                $request->setHeaders(array(
                  'content-type' => 'application/json'
                ));

                $request->setBody("{
                  'Emails': ['example@server.com','example1@server.com','example2@server.com'],
                  'ResultURL' : 'http://www.returnurl.com',
                  'AnalyzeAllMXRecords': false,
                  'TestPosibility': true,
                  'AuthorizationKey': 'a1a1a1a1-b2b2-c3c3-d4d4-e5e5e5e5e5e5'
                }");

                try {
                  $response = $request->send();

                  echo $response->getBody();
                } catch (HttpException $ex) {
                  echo $ex;
                }