ईमेल भेजे बिना सत्यापित करें: तकनीकी गाइड

Leo
LeoFounder, BillionVerify

ईमेल भेजे बिना सत्यापित करें। सिंटैक्स वैलिडेशन, DNS चेक, MX रिकॉर्ड, SMTP हैंडशेक और API सत्यापन उदाहरणों के साथ।

Cover Image for ईमेल भेजे बिना सत्यापित करें: तकनीकी गाइड

डेवलपर्स और मार्केटर्स द्वारा पूछे जाने वाले सबसे आम सवालों में से एक है: "मैं वास्तव में ईमेल भेजे बिना किसी ईमेल एड्रेस को कैसे सत्यापित कर सकता हूं?" यह एक वैध चिंता है—संभावित रूप से अमान्य एड्रेस पर सत्यापन ईमेल भेजना आपकी सेंडर reputation को नुकसान पहुंचा सकता है, संसाधनों को बर्बाद कर सकता है और एक खराब user experience बना सकता है। सौभाग्य से, ईमेल एड्रेस को validate करने के कई सिद्ध तरीके हैं जिनसे वास्तविक ईमेल delivery को trigger नहीं किया जाता।

इस व्यापक गाइड में, हम ईमेल एड्रेस को बिना भेजे सत्यापित करने के पांच विभिन्न तरीकों का पता लगाएंगे, जो simple syntax validation से लेकर sophisticated SMTP handshake techniques तक हैं। चाहे आप signup form बना रहे हों या email list को साफ कर रहे मार्केटर हों, आपको ऐसे व्यावहारिक समाधान मिलेंगे जो आपकी तकनीकी आवश्यकताओं और accuracy की जरूरतों से मेल खाते हों।

इन email verification techniques को समझना उन लोगों के लिए आवश्यक है जो email deliverability को बनाए रखने के बारे में गंभीर हैं। एक मजबूत email verification रणनीति यह जानने से शुरू होती है कि email validity को कैसे check करें इससे पहले कि आपका पहला message कभी आपके mail server से निकले। आइए उन तरीकों में गहराई से जाएं जो इसे संभव बनाते हैं।

ईमेल भेजे बिना क्यों सत्यापित करें?

इससे पहले कि हम तकनीकी विधियों का पता लगाएं, आइए समझें कि क्यों ईमेल भेजे बिना सत्यापन आपके व्यवसाय के लिए महत्वपूर्ण है:

अपनी सेंडर reputation की रक्षा करें

आप जो भी ईमेल भेजते हैं वह आपके sender reputation score को प्रभावित करता है। जब आप invalid addresses पर ईमेल भेजते हैं, तो वे bounce back हो जाते हैं, और ISPs इस पर ध्यान देते हैं। बहुत अधिक bounces email providers को संकेत देते हैं कि आप एक spammer हो सकते हैं, जो आपके legitimate emails को spam folders में डाल सकता है या आपके domain को पूरी तरह से blacklist कर सकता है।

भेजने से पहले email addresses को verify करके, आप इन damaging bounces को कभी होने से रोकते हैं। यह proactive approach आपकी sender reputation को intact रखता है और सुनिश्चित करता है कि आपके important messages उनके intended recipients तक पहुंचें।

समय और संसाधनों की बचत करें

ईमेल भेजने में पैसा खर्च होता है—चाहे आप ESP के माध्यम से प्रति ईमेल भुगतान कर रहे हों या अपना खुद का email infrastructure maintain कर रहे हों। उन addresses पर भेजने में संसाधनों को क्यों बर्बाद करें जो कभी आपका message receive नहीं करेंगे? Pre-send verification इस waste को खत्म करता है invalid addresses को आपके email workflow में प्रवेश करने से पहले filter करके।

इसके अलावा, bounced emails के साथ deal करने में processing power और manual review time की आवश्यकता होती है। Invalid emails को upfront catch करके, आप अपने operations को streamline करते हैं और अपनी team को अधिक valuable tasks पर focus करने देते हैं।

user experience में सुधार करें

Signup forms में, real-time email validation उन users को immediate feedback प्रदान करता है जिन्होंने अपना email address गलत type किया हो सकता है। यह instant correction confirmation emails न मिलने की निराशा को रोकता है और "missing" verification links के बारे में support tickets को कम करता है।

डेटा quality बनाए रखें

आपकी email list एक valuable business asset है। आपके database में हर invalid email address noise को represent करता है जो analysis को कठिन और segmentation को कम effective बनाता है। ईमेल को बिना भेजे verify करना आपको पहले दिन से एक clean, accurate database maintain करने में मदद करता है।

अब आइए actual messages भेजे बिना email verification प्राप्त करने के पांच primary methods का पता लगाएं।

Method 1: Syntax Validation

Syntax validation email verification की पहली और सबसे simple layer है। यह check करता है कि क्या email address RFC 5321 और RFC 5322 specifications द्वारा परिभाषित proper format rules का पालन करता है।

Syntax validation क्या check करता है

एक valid email address को specific formatting rules का पालन करना चाहिए:

  • बिल्कुल एक @ symbol होता है
  • एक local part (@ से पहले) होता है जो naming conventions का पालन करता है
  • एक domain part (@ के बाद) होता है जिसमें valid structure है
  • केवल permitted characters का उपयोग करता है
  • Length limitations का respect करता है (local part max 64 characters, total max 254 characters)

JavaScript Implementation

यहां email syntax validation के लिए एक practical JavaScript function है:

function validateEmailSyntax(email) {
  // Trim whitespace
  email = email.trim();

  // Check basic length constraints
  if (email.length > 254) {
    return { valid: false, reason: 'Email address too long' };
  }

  // RFC 5322 compliant regex pattern
  const emailRegex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;

  if (!emailRegex.test(email)) {
    return { valid: false, reason: 'Invalid email format' };
  }

  // Extract local part and check length
  const localPart = email.split('@')[0];
  if (localPart.length > 64) {
    return { valid: false, reason: 'Local part too long' };
  }

  return { valid: true, reason: 'Syntax is valid' };
}

// Usage examples
console.log(validateEmailSyntax('user@example.com'));
// { valid: true, reason: 'Syntax is valid' }

console.log(validateEmailSyntax('invalid.email@'));
// { valid: false, reason: 'Invalid email format' }

console.log(validateEmailSyntax('user@domain'));
// { valid: false, reason: 'Invalid email format' }

Common use cases के लिए simplified regex

जबकि RFC-compliant regex comprehensive है, कई applications एक simpler pattern का उपयोग करते हैं जो सबसे common formatting errors को catch करता है:

function simpleEmailValidation(email) {
  const simpleRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
  return simpleRegex.test(email.trim());
}

Syntax validation की सीमाएं

अकेले syntax validation यह निर्धारित नहीं कर सकता कि email address वास्तव में मौजूद है। Address definitely.fake.address@gmail.com syntax validation को perfectly pass करता है, लेकिन Gmail के पास ऐसा कोई account नहीं है। इस कारण से, syntax validation आपकी पहली check होनी चाहिए, न कि आपकी एकमात्र check।

Accuracy Level: ~30-40% (केवल obvious typos और formatting errors को catch करता है)

Method 2: Domain/DNS Validation

Verification की दूसरी layer check करती है कि email address का domain portion वास्तव में मौजूद है और internet पर properly configured है।

DNS validation क्या check करता है

Domain validation यह verify करता है कि:

  • Domain DNS में मौजूद है
  • Domain valid records पर resolve होता है
  • Domain expire नहीं हुआ है या abandoned नहीं किया गया है

Node.js Implementation

यहां Node.js में DNS validation perform करने का तरीका है:

const dns = require('dns').promises;

async function validateDomain(email) {
  const domain = email.split('@')[1];

  if (!domain) {
    return { valid: false, reason: 'No domain found in email' };
  }

  try {
    // Try to resolve the domain's A or AAAA records
    const addresses = await dns.resolve(domain);

    if (addresses && addresses.length > 0) {
      return {
        valid: true,
        reason: 'Domain exists',
        addresses: addresses
      };
    }

    return { valid: false, reason: 'Domain has no DNS records' };
  } catch (error) {
    if (error.code === 'ENOTFOUND') {
      return { valid: false, reason: 'Domain does not exist' };
    }
    if (error.code === 'ENODATA') {
      return { valid: false, reason: 'No data for domain' };
    }
    return { valid: false, reason: `DNS error: ${error.message}` };
  }
}

// Usage
async function checkEmail(email) {
  const result = await validateDomain(email);
  console.log(`${email}: ${result.reason}`);
  return result;
}

checkEmail('user@google.com');  // Domain exists
checkEmail('user@thisisnotarealdomain12345.com');  // Domain does not exist

Python Implementation

import dns.resolver

def validate_domain(email):
    try:
        domain = email.split('@')[1]
    except IndexError:
        return {'valid': False, 'reason': 'Invalid email format'}

    try:
        # Try to resolve A records
        answers = dns.resolver.resolve(domain, 'A')
        return {
            'valid': True,
            'reason': 'Domain exists',
            'addresses': [str(rdata) for rdata in answers]
        }
    except dns.resolver.NXDOMAIN:
        return {'valid': False, 'reason': 'Domain does not exist'}
    except dns.resolver.NoAnswer:
        return {'valid': False, 'reason': 'No DNS records found'}
    except dns.exception.Timeout:
        return {'valid': False, 'reason': 'DNS query timeout'}
    except Exception as e:
        return {'valid': False, 'reason': f'DNS error: {str(e)}'}

# Usage
result = validate_domain('user@gmail.com')
print(result)

सीमाएं

एक domain email accept किए बिना मौजूद हो सकता है। इसके विपरीत, एक valid email domain network issues के कारण temporarily DNS resolution में fail हो सकता है। Domain validation अकेले syntax से अधिक confidence प्रदान करता है लेकिन email deliverability की confirm नहीं करता है।

Accuracy Level: ~50-60% (non-existent domains को filter करता है)

Method 3: MX Record Validation

MX (Mail Exchange) record validation basic domain checking से एक significant step up है। MX records specifically indicate करते हैं कि कौन से mail servers एक domain के लिए email accept करने के responsible हैं।

MX records हमें क्या बताते हैं

DNS में MX records यह specify करते हैं:

  • कौन से servers किसी domain के लिए incoming email को handle करते हैं
  • Multiple mail servers का priority order
  • क्या domain email receive करने के लिए configured है

MX records के बिना एक domain अभी भी मौजूद हो सकता है लेकिन email receive नहीं कर सकता।

Node.js Implementation

const dns = require('dns').promises;

async function validateMXRecords(email) {
  const domain = email.split('@')[1];

  if (!domain) {
    return { valid: false, reason: 'No domain found' };
  }

  try {
    const mxRecords = await dns.resolveMx(domain);

    if (mxRecords && mxRecords.length > 0) {
      // Sort by priority (lower number = higher priority)
      mxRecords.sort((a, b) => a.priority - b.priority);

      return {
        valid: true,
        reason: 'MX records found',
        mxRecords: mxRecords.map(mx => ({
          host: mx.exchange,
          priority: mx.priority
        }))
      };
    }

    return { valid: false, reason: 'No MX records configured' };
  } catch (error) {
    if (error.code === 'ENOTFOUND') {
      return { valid: false, reason: 'Domain does not exist' };
    }
    if (error.code === 'ENODATA') {
      // Some domains use A records as fallback for email
      try {
        const aRecords = await dns.resolve(domain);
        if (aRecords && aRecords.length > 0) {
          return {
            valid: true,
            reason: 'No MX records, but A records exist (fallback)',
            fallbackAddress: aRecords[0]
          };
        }
      } catch {
        // Ignore fallback check errors
      }
      return { valid: false, reason: 'No MX records and no fallback' };
    }
    return { valid: false, reason: `Error: ${error.message}` };
  }
}

// Example usage
async function checkMX(email) {
  const result = await validateMXRecords(email);
  console.log(`\n${email}:`);
  console.log(`Valid: ${result.valid}`);
  console.log(`Reason: ${result.reason}`);
  if (result.mxRecords) {
    console.log('MX Records:');
    result.mxRecords.forEach(mx => {
      console.log(`  Priority ${mx.priority}: ${mx.host}`);
    });
  }
  return result;
}

// Test different domains
checkMX('user@gmail.com');
checkMX('user@outlook.com');
checkMX('user@fakeinvaliddomain123.com');

Python Implementation

import dns.resolver

def validate_mx_records(email):
    try:
        domain = email.split('@')[1]
    except IndexError:
        return {'valid': False, 'reason': 'Invalid email format'}

    try:
        mx_records = dns.resolver.resolve(domain, 'MX')
        records = sorted(
            [(r.preference, str(r.exchange)) for r in mx_records],
            key=lambda x: x[0]
        )
        return {
            'valid': True,
            'reason': 'MX records found',
            'mx_records': [{'priority': p, 'host': h} for p, h in records]
        }
    except dns.resolver.NXDOMAIN:
        return {'valid': False, 'reason': 'Domain does not exist'}
    except dns.resolver.NoAnswer:
        # Check for A record fallback
        try:
            a_records = dns.resolver.resolve(domain, 'A')
            return {
                'valid': True,
                'reason': 'No MX records, using A record fallback',
                'fallback': str(a_records[0])
            }
        except:
            return {'valid': False, 'reason': 'No MX records and no fallback'}
    except Exception as e:
        return {'valid': False, 'reason': f'Error: {str(e)}'}

# Example usage
emails = ['user@gmail.com', 'user@microsoft.com', 'user@nodomainhere.xyz']
for email in emails:
    result = validate_mx_records(email)
    print(f"\n{email}:")
    print(f"  Valid: {result['valid']}")
    print(f"  Reason: {result['reason']}")
    if 'mx_records' in result:
        for mx in result['mx_records']:
            print(f"  MX: {mx['priority']} - {mx['host']}")

MX record results को समझना

जब आप major email providers के लिए MX records query करते हैं, तो आपको इस तरह के results दिखाई देंगे:

Gmail (google.com):

  • Priority 5: gmail-smtp-in.l.google.com
  • Priority 10: alt1.gmail-smtp-in.l.google.com
  • Priority 20: alt2.gmail-smtp-in.l.google.com

Outlook (outlook.com):

  • Priority 10: outlook-com.olc.protection.outlook.com

Multiple MX records redundancy प्रदान करते हैं—यदि एक mail server down है, तो messages backup server पर route हो जाते हैं।

Accuracy Level: ~70-75% (confirm करता है कि domain email receive कर सकता है)

Method 4: SMTP Handshake Verification

SMTP handshake verification बिना भेजे email existence check करने का सबसे sophisticated method है। यह email delivery process की शुरुआत को simulate करता है, message को actually transmit करने से ठीक पहले रुक जाता है।

SMTP verification कैसे काम करता है

SMTP protocol email delivery के लिए एक specific sequence का पालन करता है। SMTP verification early stages को execute करता है:

  1. Connect mail server से (typically port 25)
  2. HELO/EHLO - Mail server के लिए खुद को identify करें
  3. MAIL FROM - Sender address specify करें
  4. RCPT TO - Recipient specify करें (जिस address को आप verify कर रहे हैं)
  5. Analyze response - Server की response indicate करती है कि क्या recipient मौजूद है

यदि mail server RCPT TO command को accept करता है (response code 250), तो email address संभवतः मौजूद है। एक rejection (5xx response) आमतौर पर means करता है कि address invalid है।

Node.js Implementation

const net = require('net');
const dns = require('dns').promises;

class SMTPVerifier {
  constructor(timeout = 10000) {
    this.timeout = timeout;
  }

  async verify(email) {
    const domain = email.split('@')[1];

    // First, get MX records
    let mxHost;
    try {
      const mxRecords = await dns.resolveMx(domain);
      mxRecords.sort((a, b) => a.priority - b.priority);
      mxHost = mxRecords[0].exchange;
    } catch (error) {
      return {
        valid: false,
        reason: 'Could not resolve MX records',
        email
      };
    }

    return new Promise((resolve) => {
      const socket = new net.Socket();
      let step = 0;
      let response = '';

      const commands = [
        null, // Initial server greeting
        'EHLO verify.local\r\n',
        'MAIL FROM:<verify@verify.local>\r\n',
        `RCPT TO:<${email}>\r\n`,
        'QUIT\r\n'
      ];

      socket.setTimeout(this.timeout);

      socket.on('connect', () => {
        console.log(`Connected to ${mxHost}`);
      });

      socket.on('data', (data) => {
        response = data.toString();
        const code = parseInt(response.substring(0, 3));

        console.log(`Step ${step}: ${response.trim()}`);

        // Handle each step
        if (step === 0) {
          // Server greeting - expect 220
          if (code === 220) {
            socket.write(commands[1]);
            step++;
          } else {
            resolve({ valid: false, reason: 'Server rejected connection', email });
            socket.destroy();
          }
        } else if (step === 1) {
          // EHLO response - expect 250
          if (code === 250) {
            socket.write(commands[2]);
            step++;
          } else {
            resolve({ valid: false, reason: 'EHLO rejected', email });
            socket.destroy();
          }
        } else if (step === 2) {
          // MAIL FROM response - expect 250
          if (code === 250) {
            socket.write(commands[3]);
            step++;
          } else {
            resolve({ valid: false, reason: 'MAIL FROM rejected', email });
            socket.destroy();
          }
        } else if (step === 3) {
          // RCPT TO response - this is the verification result
          socket.write(commands[4]);

          if (code === 250) {
            resolve({ valid: true, reason: 'Email address exists', email });
          } else if (code === 550 || code === 551 || code === 553) {
            resolve({ valid: false, reason: 'Email address does not exist', email });
          } else if (code === 452 || code === 421) {
            resolve({ valid: null, reason: 'Server temporarily unavailable', email });
          } else {
            resolve({ valid: null, reason: `Uncertain: ${response.trim()}`, email });
          }
          socket.destroy();
        }
      });

      socket.on('timeout', () => {
        resolve({ valid: null, reason: 'Connection timeout', email });
        socket.destroy();
      });

      socket.on('error', (error) => {
        resolve({ valid: null, reason: `Socket error: ${error.message}`, email });
        socket.destroy();
      });

      // Connect to mail server
      socket.connect(25, mxHost);
    });
  }
}

// Usage
async function verifyEmail(email) {
  const verifier = new SMTPVerifier();
  const result = await verifier.verify(email);
  console.log(`\nResult for ${email}:`);
  console.log(`Valid: ${result.valid}`);
  console.log(`Reason: ${result.reason}`);
  return result;
}

verifyEmail('test@example.com');

Python Implementation

import socket
import dns.resolver

class SMTPVerifier:
    def __init__(self, timeout=10):
        self.timeout = timeout

    def get_mx_host(self, domain):
        """Get the primary MX host for a domain."""
        try:
            records = dns.resolver.resolve(domain, 'MX')
            mx_records = sorted(
                [(r.preference, str(r.exchange).rstrip('.')) for r in records],
                key=lambda x: x[0]
            )
            return mx_records[0][1]
        except Exception as e:
            return None

    def verify(self, email):
        """Verify an email address via SMTP handshake."""
        try:
            domain = email.split('@')[1]
        except IndexError:
            return {'valid': False, 'reason': 'Invalid email format'}

        mx_host = self.get_mx_host(domain)
        if not mx_host:
            return {'valid': False, 'reason': 'Could not resolve MX records'}

        try:
            # Connect to mail server
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.settimeout(self.timeout)
            sock.connect((mx_host, 25))

            # Receive greeting
            response = sock.recv(1024).decode()
            if not response.startswith('220'):
                return {'valid': False, 'reason': 'Server rejected connection'}

            # Send EHLO
            sock.send(b'EHLO verify.local\r\n')
            response = sock.recv(1024).decode()
            if not response.startswith('250'):
                return {'valid': False, 'reason': 'EHLO rejected'}

            # Send MAIL FROM
            sock.send(b'MAIL FROM:<verify@verify.local>\r\n')
            response = sock.recv(1024).decode()
            if not response.startswith('250'):
                return {'valid': False, 'reason': 'MAIL FROM rejected'}

            # Send RCPT TO - this is the verification
            sock.send(f'RCPT TO:<{email}>\r\n'.encode())
            response = sock.recv(1024).decode()
            code = int(response[:3])

            # Close connection
            sock.send(b'QUIT\r\n')
            sock.close()

            # Analyze response
            if code == 250:
                return {'valid': True, 'reason': 'Email address exists'}
            elif code in [550, 551, 553]:
                return {'valid': False, 'reason': 'Email address does not exist'}
            elif code in [452, 421]:
                return {'valid': None, 'reason': 'Server temporarily unavailable'}
            else:
                return {'valid': None, 'reason': f'Uncertain response: {response}'}

        except socket.timeout:
            return {'valid': None, 'reason': 'Connection timeout'}
        except socket.error as e:
            return {'valid': None, 'reason': f'Socket error: {str(e)}'}
        except Exception as e:
            return {'valid': None, 'reason': f'Error: {str(e)}'}

# Usage
verifier = SMTPVerifier()
result = verifier.verify('test@example.com')
print(f"Valid: {result['valid']}")
print(f"Reason: {result['reason']}")

SMTP response codes की व्याख्या

Verification results को interpret करने के लिए SMTP response codes को समझना crucial है:

CodeMeaningInterpretation
250OKEmail address मौजूद है और mail accept करता है
251User not localकिसी अन्य address पर forward करेगा
450Mailbox unavailableTemporary issue, बाद में फिर से try करें
451Local errorServer-side problem
452Insufficient storageMailbox full
550Mailbox not foundEmail address मौजूद नहीं है
551User not localकोई forwarding configured नहीं है
553Mailbox name invalidMailbox name में syntax error

महत्वपूर्ण सीमाएं

SMTP verification में कई significant limitations हैं:

  1. Catch-All Domains: कुछ mail servers सभी addresses को accept करते हैं चाहे वे मौजूद हों या नहीं, सब कुछ के लिए 250 return करते हैं। ये "catch-all" configurations SMTP verification को defeat करते हैं।

  2. Greylisting: Servers unknown senders से messages को temporarily reject कर सकते हैं। आपका verification एक rejection प्राप्त कर सकता है जो retry पर succeed करेगा।

  3. Rate Limiting: Mail servers अक्सर connection attempts को limit करते हैं। High-volume verification blocks trigger कर सकता है।

  4. IP Reputation: आपके verification server का IP reputation प्रभावित करता है कि mail servers honestly respond करेंगे या नहीं।

  5. Firewall Restrictions: कई networks security कारणों से port 25 पर outbound SMTP traffic को block करते हैं।

Accuracy Level: ~85-90% (जब servers honestly respond करते हैं)

Method 5: Email Verification API Services

Production applications के लिए, professional email verification API का उपयोग accuracy, speed और reliability का सबसे अच्छा balance प्रदान करता है। BillionVerify जैसी services multi-method verification की सभी complexity को handle करती हैं जबकि additional checks प्रदान करती हैं जो individual methods achieve नहीं कर सकते।

API-based verification के फायदे

Higher Accuracy: Professional services सभी verification methods (syntax, DNS, MX, SMTP) को additional intelligence जैसे disposable email detection, role-based address identification और catch-all domain handling के साथ combine करती हैं।

Better Infrastructure: API services dedicated IP pools maintain करती हैं जिनकी strong reputations हैं, faster global response के लिए distributed servers हैं और major email providers के साथ direct relationships हैं।

No Maintenance: आपको SMTP verification code maintain करने, edge cases handle करने या अपने verification server के block होने की चिंता करने की आवश्यकता नहीं है।

Scalability: APIs infrastructure concerns के बिना लाखों verifications handle करते हैं।

BillionVerify API Integration

यहां email verification के लिए BillionVerify API को integrate करने का तरीका है:

Node.js Example:

const axios = require('axios');

const BV_API_KEY = 'your_api_key_here';
const API_URL = 'https://api.billionverify.com/v1';

async function verifyEmailWithAPI(email) {
  try {
    const response = await axios.post(
      `${API_URL}/verify`,
      { email },
      {
        headers: {
          'Authorization': `Bearer ${BV_API_KEY}`,
          'Content-Type': 'application/json'
        }
      }
    );

    const result = response.data;

    return {
      email: result.email,
      valid: result.deliverable,
      status: result.status,
      details: {
        syntaxValid: result.syntax_valid,
        domainExists: result.domain_exists,
        mxRecords: result.mx_found,
        smtpCheck: result.smtp_check,
        disposable: result.is_disposable,
        roleAddress: result.is_role_address,
        catchAll: result.is_catch_all,
        freeProvider: result.is_free_provider
      },
      score: result.quality_score
    };
  } catch (error) {
    console.error('API Error:', error.response?.data || error.message);
    throw error;
  }
}

// Usage
async function main() {
  const emails = [
    'valid.user@gmail.com',
    'fake.address@company.com',
    'temp@10minutemail.com'
  ];

  for (const email of emails) {
    const result = await verifyEmailWithAPI(email);
    console.log(`\n${email}:`);
    console.log(`  Deliverable: ${result.valid}`);
    console.log(`  Status: ${result.status}`);
    console.log(`  Quality Score: ${result.score}`);
    console.log(`  Disposable: ${result.details.disposable}`);
    console.log(`  Catch-All: ${result.details.catchAll}`);
  }
}

main();

Python Example:

import requests

BV_API_KEY = 'your_api_key_here'
API_URL = 'https://api.billionverify.com/v1'

def verify_email_with_api(email):
    """Verify an email address using BillionVerify API."""
    headers = {
        'Authorization': f'Bearer {BV_API_KEY}',
        'Content-Type': 'application/json'
    }

    response = requests.post(
        f'{API_URL}/verify',
        json={'email': email},
        headers=headers
    )

    if response.status_code != 200:
        raise Exception(f'API Error: {response.text}')

    result = response.json()

    return {
        'email': result['email'],
        'valid': result['deliverable'],
        'status': result['status'],
        'details': {
            'syntax_valid': result['syntax_valid'],
            'domain_exists': result['domain_exists'],
            'mx_records': result['mx_found'],
            'smtp_check': result['smtp_check'],
            'disposable': result['is_disposable'],
            'role_address': result['is_role_address'],
            'catch_all': result['is_catch_all'],
            'free_provider': result['is_free_provider']
        },
        'score': result['quality_score']
    }

# Usage
emails = ['user@gmail.com', 'contact@company.com', 'test@tempmail.com']

for email in emails:
    try:
        result = verify_email_with_api(email)
        print(f"\n{email}:")
        print(f"  Deliverable: {result['valid']}")
        print(f"  Status: {result['status']}")
        print(f"  Quality Score: {result['score']}")
    except Exception as e:
        print(f"Error verifying {email}: {e}")

Real-time form integration

Signup forms के लिए, BillionVerify real-time verification प्रदान करता है जो users के type करते समय email addresses को validate कर सकता है:

// React component example
import { useState, useCallback } from 'react';
import debounce from 'lodash/debounce';

function EmailInput() {
  const [email, setEmail] = useState('');
  const [validation, setValidation] = useState(null);
  const [loading, setLoading] = useState(false);

  const verifyEmail = useCallback(
    debounce(async (emailToVerify) => {
      if (!emailToVerify || emailToVerify.length < 5) return;

      setLoading(true);
      try {
        const response = await fetch('/api/verify-email', {
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({ email: emailToVerify })
        });
        const result = await response.json();
        setValidation(result);
      } catch (error) {
        console.error('Verification failed:', error);
      } finally {
        setLoading(false);
      }
    }, 500),
    []
  );

  const handleChange = (e) => {
    const newEmail = e.target.value;
    setEmail(newEmail);
    verifyEmail(newEmail);
  };

  return (
    <div className="email-input-wrapper">
      <input
        type="email"
        value={email}
        onChange={handleChange}
        placeholder="Enter your email"
        className={validation?.valid === false ? 'invalid' : ''}
      />
      {loading && <span className="loading">Verifying...</span>}
      {validation && !loading && (
        <span className={validation.valid ? 'valid' : 'invalid'}>
          {validation.valid ? '✓ Valid email' : '✗ ' + validation.reason}
        </span>
      )}
    </div>
  );
}

Accuracy Level: 97-99%+ (सभी methods को additional intelligence के साथ combine करता है)

Method तुलना: सही दृष्टिकोण चुनना

यहां एक comprehensive comparison है जो आपको अपनी जरूरतों के लिए सही verification method चुनने में मदद करती है:

MethodAccuracySpeedComplexityCostBest For
Syntax Validation30-40%InstantLowFreeFirst-line filtering
Domain/DNS Check50-60%FastLowFreeQuick pre-checks
MX Record Validation70-75%FastMediumFreeForm validation
SMTP Handshake85-90%SlowHighInfrastructureBatch cleaning
API Service97-99%FastLowPer-queryProduction systems

Use case के अनुसार सिफारिशें

Signup Forms: Instant feedback के लिए client-side syntax validation और submit पर API verification के combination का उपयोग करें। यह data quality सुनिश्चित करते हुए smooth user experience प्रदान करता है।

Email Marketing Campaigns: भेजने से पहले bulk verification के लिए API service का उपयोग करें। प्रति verification की cost high bounce rates से होने वाली damage से बहुत कम है।

Data Cleaning Projects: Bulk upload capability वाली API services मौजूदा lists को clean करने के लिए accuracy और efficiency का सबसे अच्छा balance प्रदान करती हैं।

Development/Testing: Syntax और MX validation development environments के लिए adequate accuracy प्रदान करते हैं जहां perfect accuracy critical नहीं है।

Email Verification के लिए Best Practices

Multiple layers implement करें

एकल verification method पर rely न करें। एक layered approach implement करें:

  1. Immediate: Client side पर syntax validation
  2. On Submit: Quick server-side validation के लिए MX record check
  3. Before Campaign: Deliverability confirmation के लिए full API verification

Edge cases को gracefully handle करें

कुछ verification results inconclusive होते हैं (catch-all domains, temporary failures)। अपने system को design करें:

  • Uncertain verification results वाले addresses को accept करें लेकिन review के लिए flag करें
  • Temporary failures के लिए retry logic implement करें
  • Patterns identify करने के लिए verification results को track करें

सही समय पर verify करें

  • Registration: Account creation से पहले verify करें
  • Import: External sources से lists import करते समय verify करें
  • Periodic: Re-engagement campaigns से पहले dormant addresses को re-verify करें
  • Before Major Sends: बड़े campaigns से पहले हमेशा verify करें

Rate limits का respect करें

चाहे आप अपना खुद का SMTP verification उपयोग कर रहे हों या API, mail servers और service providers के साथ अच्छे relationships maintain करने के लिए rate limits का respect करें।

निष्कर्ष

Actual emails भेजे बिना email addresses को verify करना न केवल संभव है बल्कि email deliverability और sender reputation को maintain करने के लिए आवश्यक है। Simple syntax checks से लेकर sophisticated API-based verification तक, आपके पास अपनी accuracy requirements और technical capabilities के आधार पर कई विकल्प हैं।

अधिकांश production applications के लिए, हम recommend करते हैं:

  1. Start simple: Immediate feedback के लिए syntax validation implement करें
  2. Add depth: Server-side validation के लिए DNS और MX checks शामिल करें
  3. Go professional: Production-quality verification के लिए BillionVerify जैसी API service का उपयोग करें

Professional email verification implement करने के लिए तैयार हैं? Verification को action में देखने के लिए हमारे email checker tool को check करें, या अपने applications में seamless integration के लिए BillionVerify API explore करें।

Proper email verification implement करके, आप अपनी sender reputation की रक्षा करेंगे, deliverability rates में सुधार करेंगे और सुनिश्चित करेंगे कि आपके messages उन लोगों तक पहुंचें जो उन्हें receive करना चाहते हैं। आज smarter verification शुरू करें।

Instantly या Smartlead का उपयोग करने वाली टीमें हर अभियान से पहले BillionVerify से सूचियाँ साफ करके डिलीवरेबिलिटी में उल्लेखनीय सुधार करती हैं।

वेरिफिकेशन प्रोवाइडर चुनने से पहले सटीकता और गति के मामले में BillionVerify की तुलना ZeroBounce से करें।

Leo
LeoFounder, BillionVerify
ईमेल सत्यापन अंतर्दृष्टि

आज ही सत्यापन शुरू करें

आज ही BillionVerify के साथ ईमेल सत्यापन शुरू करें। साइन अप करने पर 100 मुफ्त क्रेडिट प्राप्त करें - किसी क्रेडिट कार्ड की आवश्यकता नहीं। हजारों व्यवसायों में शामिल हों जो सटीक ईमेल सत्यापन के साथ अपने ईमेल मार्केटिंग ROI में सुधार कर रहे हैं।

किसी क्रेडिट कार्ड की आवश्यकता नहीं · प्रतिदिन 100+ मुफ्त क्रेडिट · 30 सेकंड में शुरू करें

99.9%
सटीकता
Real-time
API गति
$0.00014
प्रति ईमेल
100/day
हमेशा मुफ़्त