PHPackages                             beastbytes/emailobfuscator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. beastbytes/emailobfuscator

ActiveExtension[Mail &amp; Notifications](/categories/mail)

beastbytes/emailobfuscator
==========================

Widget to obfuscate email addresses

v1.0.0(3y ago)00BSD-3-ClausePHPPHP &gt;=8.0

Since Jun 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/beastbytes/email-obfuscator)[ Packagist](https://packagist.org/packages/beastbytes/emailobfuscator)[ RSS](/packages/beastbytes-emailobfuscator/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

emailobfuscator
===============

[](#emailobfuscator)

Widget to obfuscate an email address to help prevent harvesting by spam bots.

If JavaScript is disabled on the client, the widget will output either a message or an obfuscated version of the email address.

If JavaScript is enabled the output is replaced with (by default) a mailto link showing (again by default) the email address. The content of the mailto link can be customised.

For license information see the [LICENSE](LICENSE.md) file.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist beastbytes/emailobfuscator

```

or add

```
"beastbytes/emailobfuscator": "^1.0"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

Use this extension in a view.

To output the default message ("This e-mail address is protected to prevent harvesting by spam-bots")

```
echo EmailObfuscator::widget([
    'email' => 'my.address@example.com'
]);
```

### Output

[](#output)

#### JavaScript Disabled

[](#javascript-disabled)

```
This e-mail address is protected to prevent harvesting by spam-bots
```

#### JavaScript Enabled

[](#javascript-enabled)

```
my.address@example.com
```

---

To output a different message set content\['obfuscated'\]

```
echo EmailObfuscator::widget([
    'email' => 'my.address@example.com',
    'content' => ['obfuscated' => 'Enable JavaScript to see the email address']
]);
```

### Output

[](#output-1)

#### JavaScript Disabled

[](#javascript-disabled-1)

```
Enable JavaScript to see the email address
```

#### JavaScript Enabled

[](#javascript-enabled-1)

```
my.address@example.com
```

---

To output an obfuscated version of the email address set the obfuscators: "my dot address at example dot com"

```
echo EmailObfuscator::widget([
    'email' => 'my.address@example.com',
    'obfuscators' => [' dot ', ' at ']
]);
```

### Output

[](#output-2)

#### JavaScript Disabled

[](#javascript-disabled-2)

```
my dot address at example dot com
```

#### JavaScript Enabled

[](#javascript-enabled-2)

```
my.address@example.com
```

---

To set the content of the mailto link, set content\['clear'\]

```
echo EmailObfuscator::widget([
    'email' => 'my.address@example.com',
    'content' => ['clear' => 'by email']
]);
```

### Output

[](#output-3)

#### JavaScript Disabled

[](#javascript-disabled-3)

```
This e-mail address is protected to prevent harvesting by spam-bots
```

#### JavaScript Enabled

[](#javascript-enabled-3)

```
by email
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0b5133b5137b26eeb25056449c28364ac0af31836eefba78912a9c8f0743aa3?d=identicon)[BeastBytes](/maintainers/BeastBytes)

---

Top Contributors

[![beastbytes](https://avatars.githubusercontent.com/u/1470144?v=4)](https://github.com/beastbytes "beastbytes (4 commits)")

---

Tags

emailobfuscatewidgetobfuscationemail address

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/beastbytes-emailobfuscator/health.svg)

```
[![Health](https://phpackages.com/badges/beastbytes-emailobfuscator/health.svg)](https://phpackages.com/packages/beastbytes-emailobfuscator)
```

###  Alternatives

[egulias/email-validator

A library for validating emails against several RFCs

11.7k734.8M443](/packages/egulias-email-validator)[sendgrid/sendgrid

This library allows you to quickly and easily send emails through Twilio SendGrid using PHP.

1.6k50.9M190](/packages/sendgrid-sendgrid)[pelago/emogrifier

Converts CSS styles into inline style attributes in your HTML code

94746.7M138](/packages/pelago-emogrifier)[zbateson/mail-mime-parser

MIME email message parser

54753.3M91](/packages/zbateson-mail-mime-parser)[soundasleep/html2text

A PHP script to convert HTML into a plain text format

48021.2M91](/packages/soundasleep-html2text)[yiisoft/yii-dataview

Yii data displaying widgets

4360.0k3](/packages/yiisoft-yii-dataview)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
