PHPackages                             tomkirsch/html\_email - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tomkirsch/html\_email

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tomkirsch/html\_email
=====================

Library for CI4

v1.0.3(3y ago)013MITPHPPHP &gt;=7.2

Since Mar 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tomkirsch/ci4-html_email)[ Packagist](https://packagist.org/packages/tomkirsch/html_email)[ RSS](/packages/tomkirsch-html-email/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

ci4-html\_email
===============

[](#ci4-html_email)

Composer Install

```
composer require tomkirsch/html_email

```

Add the service to `Config\Services`

```
	public static function htmlEmail(array $emailConfig=[], bool $getShared=TRUE){
		return $getShared ? static::getSharedInstance('htmlEmail', $emailConfig) : new \Tomkirsch\HtmlEmail\HtmlEmail($emailConfig);
	}

```

Use it.

```
$htmlEmail = service('htmlEmail', ['protocol'=>'mail']); // you can pass an array for CI's email->initialize() if you'd like.
$htmlEmail
	->setSubject('A Test Email for YOU!')
	->section($htmlEmail::SECTION_PREHEADER)
	->p('This is the preheader. It shows up in email previews (sometimes), but not the body.')
	->section($htmlEmail::SECTION_BODY)
	->p('Well Hello There!', [
		'text-align'=>'center',
		'font-size'=>'20px',
		'font-weight'=>'bold',
	])
	->p('This is a test email that uses HTML standard from 1992, because email applications cannot get their shit together. Hopefully this looks the same in most programs.')
	->pStart(['text-align'=>'center'])
		->a([
			'url'=>'https://google.com',
			'label'=>'Plain Link',
		])
	->pEnd()
	->pStart(['text-align'=>'center'])
		->btn([
			'url'=>'https://google.com',
			'label'=>'Button',
			'align'=>'center',
		])
	->pEnd()
	->p('You can make button groups that are horizontal.')
	->btnGroup([
		'urls'=> ['https://google.com', 'https://bing.com'],
		'labels'=>['Button Group 1', 'Button Group 2'],
		'dir'=>$htmlEmail::DIR_H,
		'align'=>'center',
		'width'=>'50%',
		'spacer_w'=>10,
	])
	->p('You can also make button groups that are vertical.')
	->btnGroup([
		'urls'=> ['https://google.com', 'https://bing.com'],
		'labels'=>['Button Group 1', 'Button Group 2'],
		'dir'=>$htmlEmail::DIR_V,
		'align'=>'center',
		'width'=>'50%',
		'spacer_v'=>10,
	])
	->plaintextLine('=')
	->p(NULL, [], 'A SECRET MESSAGE FOR PLAINTEXT USERS ONLY!')
	->plaintextLine('=')
	->section('footer')
	->p('You were sent this email because you stupidly signed up for our mailing list. Deal with it.')
	->setMessage() // this sets the HTML and plain text (setAltMessage()) content. Pass a view to customize the layout.
;
// you can pass anything through to CI's email lib too
$htmlEmail
	->setFrom('me@example.com')
	->setTo('you@example.com')
	->send();
;

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~236 days

Total

4

Last Release

1180d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/362359?v=4)[Thomas Kirsch](/maintainers/tkirsch)[@tkirsch](https://github.com/tkirsch)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tomkirsch-html-email/health.svg)

```
[![Health](https://phpackages.com/badges/tomkirsch-html-email/health.svg)](https://phpackages.com/packages/tomkirsch-html-email)
```

###  Alternatives

[hermawan/codeigniter4-datatables

Serverside Datatables library for CodeIgniter4

10943.0k3](/packages/hermawan-codeigniter4-datatables)[jason-napolitano/codeigniter4-cart-module

A basic port of the codeigniter 3 cart module for CodeIgniter 4.

5814.8k](/packages/jason-napolitano-codeigniter4-cart-module)

PHPackages © 2026

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