PHP용 이메일 검증 SDK
무료 플랜이 가능합니다. 신용카드가 필요하지 않습니다.
Composer 설정
Composer를 사용하여 EmailVerify PHP SDK를 설치합니다.
composer require emailverifyio/emailverify
구현 가이드
1 표준 검증
실시간 SMTP 검증을 위한 공식 PHP 클라이언트입니다. OOP와 완벽하게 호환되며 모든 PHP 7.4+ 애플리케이션에 쉽게 통합할 수 있습니다.
use EmailVerify\Client;
$client = new Client('your_api_key');
$result = $client->verify('[email protected]');
if ($result->isValid()) {
echo "This email is deliverable!";
}
2 높은 처리량의 배치 처리
대규모 이메일 목록을 효율적으로 처리합니다. 당사의 배치 API는 높은 동시성 및 자동 상태 폴링을 통해 수백만 개의 레코드를 처리합니다.
$emails =['[email protected]', '[email protected]'];
$batch = $client->batch->create($emails);
// Polling for results
$status = $client->batch->status($batch->id);
if ($status->isCompleted()) {
$results = $client->batch->results($batch->id);
var_dump($results->summary);
}
3 클라이언트 구성
엔터프라이즈 환경을 위한 고급 구성 옵션입니다. HTTP 클라이언트에 대한 제한 시간, 프록시 및 사용자 정의 헤더를 설정합니다.
$client = new Client('key',[
'timeout' => 10.0,
'verify_ssl' => true,
'proxy' => 'tcp://localhost:8125',
'headers' =>['X-App-Name' => 'MarketingPlatform']
]);
4 이메일 파인더 API
이름과 도메인 휴리스틱을 사용하여 전문 이메일 주소를 식별합니다. 아웃리치 및 영업 리드 생성을 위한 높은 신뢰도의 결과입니다.
$lead = $client->finder->search([
'first_name' => 'John',
'last_name' => 'Wick',
'domain' => 'continental.com'
]);
if ($lead->email) {
echo "Found: " . $lead->email . " (Conf: " . $lead->confidence . "%)";
}
5 구문 수정
입력 시점에서 사용자 데이터 품질을 개선합니다. 구문 오류를 감지하고 일반적인 도메인 오타에 대한 즉각적인 제안을 제공합니다.
$check = $client->syntax->validate('[email protected]');
if (!$check->valid && $check->suggestion) {
echo "Did you mean " . $check->suggestion . "?";
}
6 프레임워크 통합
Laravel, Symfony 또는 모든 PSR 호환 프레임워크와 원활하게 통합됩니다. 종속성 주입 및 서비스 프로바이더와 완벽하게 작동합니다.
// In a Controller or Service
public function register(Request $request) {
$v = resolve(EmailVerify\Client::class)->verify($request->email);
if ($v->isDisposable()) {
return back()->withError('Disposable emails not allowed.');
}
}
7 강력한 오류 처리
특정 예외 처리를 통해 복원력 있는 통합을 구축하세요. 속도 제한, 인증 오류 및 네트워크 오류를 정상적으로 처리합니다.
try {
$res = $client->verify($email);
} catch (\EmailVerify\Exceptions\RateLimitException $e) {
// Handle 429 Too Many Requests
} catch (\EmailVerify\Exceptions\ApiException $e) {
// Handle general API issues
}
8 보안 및 위험 필터
위험한 이메일을 필터링하여 도메인 평판을 보호하세요. 보내기 전에 일회용 제공업체와 스팸 트랩을 감지합니다.
$res = $client->verify('[email protected]');
if ($res->isDisposable()) {
Log::warning("Disposable email attempt: " . $res->email);
}
if ($res->isSpamTrap()) {
echo "Warning: High risk email detected.";
}
자주 묻는 질문
PHP SDK를 어떻게 설치합니까?
설치를 위해 Composer를 사용하는 것이 좋습니다. 프로젝트에 추가하려면 `composer require emailverifyio/emailverify`를 실행하기만 하면 됩니다.
Laravel 및 Symfony와 호환됩니까?
예, SDK는 순수 PHP 라이브러리이며 모든 최신 PHP 프레임워크와 완벽하게 작동합니다.
필요한 PHP 버전은 무엇입니까?
SDK는 최신 PHP 8.x 버전을 포함하여 PHP 7.4 이상과 호환됩니다.
양식에서 실시간 검증을 지원합니까?
물론입니다. 단일 검증 방법을 사용하면 사용자가 웹 양식을 제출할 때 즉시 이메일을 검증할 수 있습니다.