emailContactLocale Aware

Mock Jutsu HOW-TO | UK

The email function within the mock-jutsu library serves as a vital tool for developers and QA engineers who require high-quality test data for modern application development. Categorised under the Contact module, this utility generates realistic, randomised email addresses that mirror the structure of genuine user credentials. By integrating mock-jutsu into your development workflow, you can instantly produce strings such as user42@gmail.com, ensuring that your databases and user interfaces are populated with data that looks and behaves like the real thing without compromising actual user privacy.

Technically, the algorithm behind this email generator focuses on syntactic accuracy and variety to meet rigorous testing requirements. It follows standardised internet protocols to ensure that every generated email is valid according to common regex patterns and validation logic. The function draws from a curated repository of popular domains, including Gmail, Outlook, and Yahoo, and pairs them with unique, randomised alphanumeric prefixes. This sophisticated approach provides a reliable stream of mock data that is ideal for testing edge cases in form validation or ensuring that your mail-handling logic functions correctly under diverse conditions.

One of the primary benefits for developers is the sheer versatility of the tool across different technical environments. Whether you are working directly in a Python script using the jutsu.generate('email') method, executing a quick command via the CLI with mockjutsu generate email, or performing large-scale load testing in JMeter using the ${__mockjutsu(email,)} syntax, the output remains consistent and dependable. This multi-platform support makes mock-jutsu an essential asset for automated testing pipelines, allowing software teams to seed databases rapidly and simulate complex user interactions without the manual overhead of creating static datasets.

Beyond simple generation, using mock data for emails is a critical practice for maintaining security and regulatory compliance during the software development lifecycle. By avoiding the use of actual contact information in staging or QA environments, teams mitigate the risk of accidental data leaks or unintentional communications to real individuals. The email function simplifies this process, offering a robust solution for stress-testing registration flows, newsletter subscriptions, and authentication systems. Ultimately, mock-jutsu empowers developers to focus on building features rather than managing sensitive information, streamlining the transition to production-ready software.

CLI Usage
mockjutsu generate email --locale TRmockjutsu generate email --locale DEmockjutsu bulk email --count 10 --locale TRmockjutsu export email --count 10 --format json --locale TRmockjutsu export email --count 10 --format csv --locale TRmockjutsu export email --count 10 --format sql --locale TR# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate email --locale TR --maskmockjutsu bulk email --count 5 --locale TR --mask
Python API
from mockjutsu import jutsujutsu.generate('email', locale='TR')jutsu.bulk('email', count=10, locale='TR')jutsu.template(['email'], count=5, locale='TR')# mask=True: regulation-compliant outputjutsu.generate('email', locale='TR', mask=True)jutsu.bulk('email', count=5, locale='TR', mask=True)
JMeter
${__mockjutsu_comm(email,TR)}# JMeter Function: __mockjutsu_comm# Parameter 1: email# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_comm(email,DE)}# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_comm(email,TR,mask)}
REST API
GET /generate/email?locale=TR# → {"type":"email","result":"...","status":"ok"}GET /bulk/email?count=10&locale=TRPOST /template {"types":["email"],"count":1,"locale":"TR"}# mask=true: regulation-compliant outputGET /generate/email?locale=TR&mask=trueGET /bulk/email?count=5&locale=TR&mask=true

Parameters

Parameter Values Description
--locale TR|UK|US|DE|FR|RU Region / locale for locale-aware output
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages