DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

How to Build a B2B Lead Enrichment and SMTP Verification Engine in Python

A staged Python pipeline can enrich company leads with MX and SMTP signals, website text, and LLM-generated fields, but an SMTP 250 is not proof of delivery.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A low-cost lead-enrichment pipeline can combine four steps: look up a domain’s mail exchanger (MX), ask its mail server to evaluate a recipient at the SMTP RCPT stage, extract a small amount of public company-site text, and use a language model to turn that context into structured fields. The $0.003-per-lead figure in the source tutorial is an author-reported estimate, not an independently verified or universal cost.

What the pipeline does

The tutorial published by Ruesch Manny on September 30, 2026 describes a workflow that gathers several useful signals rather than relying on a single enrichment lookup. Each stage contributes different information: DNS points to the domain’s mail server, an SMTP response indicates how that server handled a recipient at one transaction stage, a website fetch supplies company context, and an LLM can format that context for downstream use.

As an Amazon Associate I earn from qualifying purchases.

  1. Resolve MX: Identify the mail exchanger associated with the company’s email domain.
  2. Check SMTP recipient handling: Connect to a mail server, issue HELO, MAIL FROM, and RCPT TO, and end the session without sending DATA.
  3. Extract company context: Fetch a company page asynchronously and retain a short, cleaned text excerpt.
  4. Structure the enrichment: Ask a language model to return fields such as the company’s offering, a specific detail, and a possible outreach opening line.
  5. Hand off the result: Use asynchronous tasks and a concurrency limit to process records, then pass the results to a database, CRM, or webhook.

The tutorial presents Python, aiodns, smtplib, aiohttp, BeautifulSoup, OpenAI’s client, and Ollama-hosted models as possible components. They are implementation examples, not a tested or ranked production stack. The source tutorial is available at DEV Community.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What an SMTP recipient check can—and cannot—tell you

SMTP checks are often described as address verification, but the scope of the result matters. In the sample workflow, the connection reaches the RCPT command and stops before DATA. That means the check does not submit a message for delivery.

RFC 5321 defines RCPT as the command identifying an individual recipient in an SMTP transaction. It says: “If accepted, the SMTP server returns a "250 OK" reply and stores the forward-path.” A 250 therefore means the server accepted that recipient at the RCPT stage. It does not prove that a later message will be delivered, that it will reach the inbox, or that the mailbox will remain available. The RFC also describes cases where the receiving server cannot validate an address at RCPT time and a later delivery attempt fails. See RFC 5321, section 4.1.1.3.

  • 250: The server accepted the recipient at this point in the transaction; treat it as a positive signal, not a delivery guarantee.
  • 550: The server typically uses this response when the recipient is known not to be deliverable, but it is not the only possible failure response.
  • Other errors or timeouts: Interpret them in context. Server policy, network conditions, or the server’s inability to validate recipients can prevent a clear result.

Ending the session before DATA avoids submitting a message in that transaction. It does not establish that the sender’s domain reputation will remain unaffected under every deployment or that a recipient check predicts inbox placement.

How the enrichment stages fit together

Resolve the domain’s mail exchanger

Start with the email domain and resolve its MX record before attempting an SMTP connection. The MX result identifies where mail for the domain is routed; it does not establish that a particular mailbox exists. DNS resolution can fail or return no usable destination, so retain an explicit unresolved or error status instead of treating every unsuccessful lookup as a bad address.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Make the recipient-stage SMTP request

The described interaction sends HELO, MAIL FROM, and RCPT TO, then quits without sending DATA. A practical record should preserve the response and the stage at which the check ended, rather than reducing every outcome to a simple “valid” or “invalid” label. The Python smtplib documentation describes the standard library’s SMTP client interface.

Fetch a small amount of company-site text

The tutorial uses aiohttp for asynchronous fetching and BeautifulSoup for HTML parsing. It describes removing scripts, styles, navigation, footer, SVG, and noscript content before keeping a short text excerpt. The goal is to give the later enrichment step useful company context without passing an entire page full of boilerplate.

Company pages may be unavailable, slow, or structured in ways that yield little useful text. Treat extraction as a best-effort stage: retain a clear fetch or parsing status and do not manufacture context when the page provides none.

Ask the model for structured fields

Pass the extracted context to an LLM with a request for specific fields—for example, the detected offering, a concrete detail found in the text, and a proposed opening line. The model’s output is generated from the supplied context; it is not an independent confirmation of the company’s claims. Keeping source text alongside generated fields makes it easier for a reviewer to check whether a personalization detail is grounded in the page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Limit concurrency and hand off records

The tutorial describes asynchronous tasks controlled by a semaphore so that many records can be processed without launching unbounded concurrent work. Results can then be returned for database, CRM, or webhook handling. Concurrency is an operational control, not a guarantee of throughput: actual performance depends on network access, destination policies, site behavior, model latency, and how often work must be retried.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to interpret the cost and performance claims

The tutorial’s title and cost discussion report about $0.003 per lead. It also reports about 500 leads per hour on a $5-per-month VPS and a bounce rate below 0.8% across 2,400 corporate domains. These are claims made by the tutorial’s author, not independently replicated benchmarks. The article does not provide enough methodology to generalize those numbers across workloads, websites, model providers, networks, or hardware.

Actual per-lead cost depends on the model and its input and output tokens, retries, hosting, and any paid data or verification services. The article’s figures are useful as a description of the author’s reported result, not as a budget or performance guarantee for another deployment.

What to assess before using the workflow

This architecture brings several distinct systems together, so its practical value depends on the constraints of the deployment. Evaluate these areas before treating the output as ready for outreach:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Verification meaning: Preserve the SMTP response and stage; do not label an RCPT-stage acceptance as confirmed delivery or inbox placement.
  • Server behavior: Responses may vary with receiving-server policy, address handling, network access, and timeouts.
  • Website access and extraction: Decide how to handle failures, thin pages, and content that does not support a useful personalization detail.
  • Model use and cost: Account for the selected model, tokens, retries, and any services beyond the software components named in the tutorial.
  • Data handling and compliance: Applicable privacy, website-access, and outbound-email requirements depend on jurisdiction and operational details; the source tutorial does not establish which rules apply to a particular deployment.
  • Operational evidence: Measure your own error rates, throughput, and costs under a documented workload before relying on them for planning.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.