PHPackages                             nachoaguirre/ci4phpmailer - 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. nachoaguirre/ci4phpmailer

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

nachoaguirre/ci4phpmailer
=========================

Overrides CodeIgniter 4 Email Class to send smtp with PHPMailer

51864PHP

Since Mar 29Pushed 5y ago1 watchersCompare

[ Source](https://github.com/nachoaguirre/ci4phpmailer)[ Packagist](https://packagist.org/packages/nachoaguirre/ci4phpmailer)[ RSS](/packages/nachoaguirre-ci4phpmailer/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

CodeIgniter 4 SMTP Email with PHPMailer
=======================================

[](#codeigniter-4-smtp-email-with-phpmailer)

### A simple extension of the Email Class to send SMTP with PHPMailer library.

[](#a-simple-extension-of-the-email-class-to-send-smtp-with-phpmailer-library)

[![Latest Stable Version](https://camo.githubusercontent.com/142b0f7db30c1be065e552fdc5123d74756c894b157ab1a91b8fd668f6bb68e1/68747470733a2f2f706f7365722e707567782e6f72672f6e6163686f616775697272652f6369347068706d61696c65722f76)](//packagist.org/packages/nachoaguirre/ci4phpmailer) [![Total Downloads](https://camo.githubusercontent.com/f4c40b6962a2956f4f80ecd7606037e64ca63638f4b6e387011d069372210fa7/68747470733a2f2f706f7365722e707567782e6f72672f6e6163686f616775697272652f6369347068706d61696c65722f646f776e6c6f616473)](//packagist.org/packages/nachoaguirre/ci4phpmailer) [![Latest Unstable Version](https://camo.githubusercontent.com/4a96896ff1e291098264a105c19df6311b07b5dcb38bcff45898a6d722e9e37f/68747470733a2f2f706f7365722e707567782e6f72672f6e6163686f616775697272652f6369347068706d61696c65722f762f756e737461626c65)](//packagist.org/packages/nachoaguirre/ci4phpmailer) [![License](https://camo.githubusercontent.com/124a6d4a43fe512ce2a10d73e4b9875d0a7e3eddc95f7d877de9e1939e8e7bed/68747470733a2f2f706f7365722e707567782e6f72672f6e6163686f616775697272652f6369347068706d61696c65722f6c6963656e7365)](//packagist.org/packages/nachoaguirre/ci4phpmailer)

Tested witj CodeIgniter 4.1.1 and PHPMailer 6.3.0

Install via Composer
--------------------

[](#install-via-composer)

### To get this plugin via composer is the quick start.

[](#to-get-this-plugin-via-composer-is-the-quick-start)

This plugin utilizes Composer for its installation and PHPMailer dependency. If you haven't already, start by installing [Composer](http://getcomposer.org/doc/00-intro.md).

And are available via [Composer/Packagist](https://packagist.org/packages/nachoaguirre/ci4phpmailer). Once you have Composer configured in your environment run the command line:

```
  $  composer require nachoaguirre/ci4phpmailer

```

This command will write into composer.json beyond download and place this project files and PHPMailer dependencies into your `vendor` folder.

Your able to send e-mail anywhere inside your CodeIgniter application.

Load the library in your controller

```
 use Nachoaguirre\Ci4phpmailer\Libraries\Email
```

Then in your method, create an instance of `Mail()` class:

```
 $email = new \Nachoaguirre\Ci4phpmailer\Libraries\Email
```

Example
-------

[](#example)

Use the class in the same way you use the CI4 Email Class

```
$email = new \Nachoaguirre\Ci4phpmailer\Libraries\Email;
$config['protocol']   = 'smtp';
$config['SMTPHost']   = 'smtp.gmail.com';
$config['SMTPUser']   = 'your@gmail.com';
$config['SMTPPass']   = 'yourp4ssword';
$config['SMTPPort']   = 465;
$config['SMTPCrypto'] = 'ssl';
$email->initialize($config);

$email->setFrom('noreply@yoursite.com', 'Your Name');
$email->setTo('buddy@foo.com');

$email->setSubject('Hey dude!');
$email->setMessage('Corre que te pillo...');

$email->send();
```

That's all.

Gmail support
-------------

[](#gmail-support)

I have tested with different accounts, in different environments, and got always working 🙌

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52148018?v=4)[Ignacio Aguirre](/maintainers/nachoaguirre)[@nachoaguirre](https://github.com/nachoaguirre)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/nachoaguirre-ci4phpmailer/health.svg)

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

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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