PHPackages                             filipajdacic/yii2-cpanel-email-creator - 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. filipajdacic/yii2-cpanel-email-creator

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

filipajdacic/yii2-cpanel-email-creator
======================================

With this extension you will be able to easly to create cPanel email account from your yii2 application.

1882[1 issues](https://github.com/filipajdacic/yii2-cpanel-email-creator/issues)PHP

Since Jun 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/filipajdacic/yii2-cpanel-email-creator)[ Packagist](https://packagist.org/packages/filipajdacic/yii2-cpanel-email-creator)[ RSS](/packages/filipajdacic-yii2-cpanel-email-creator/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

cPanel Email Account Creator Extension
======================================

[](#cpanel-email-account-creator-extension)

With this extension you will be able to easly programatically create,update,delete cPanel email accounts from your yii2 application.

**With this component you are able to:**

- Create new mail accounts
- Change existing account disk quota
- Change existing accounts their passwords
- Delet accounts

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist filipajdacic/yii2-cpanel-email-creator "*"

```

or add

```
"filipajdacic/yii2-cpanel-email-creator": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by putting this in your config:

```
'components' => array(
    ...
    'cpanelemailcreator' => array(
        'class' => 'filipajdacic\cpanelemailcreator\EmailCreator',
        'ip' => 'YOUR_CPANEL_SERVER/HOST_IP_ADDRESS',
        'port' => '2083', // it can be also 2086
        'cpanel_username' => 'YOUR_CPANEL_USERNAME',
        'cpanel_password' => 'YOUR_CPANEL_PASSWORD'
    ),
    ...
);
```

After you have configured a component, you can use it in this way:

**1. Create a new mail account:**

```
$domain = "mywebsite.com";
$email_username = "john.doe";
$email_password = "myaccountpassword123!";
$email_quota = 500; // in MB

$create_mail_account_result = Yii::$app->cpanelemailcreator->createNewAccount(
	$domain,
	$email_username,
	$email_password,
	$email_quota
);

if($create_mail_account_result) {
	$result =  "Mail account ".$email_username."@".$domain." is created.";
} else {
	$result =  "Mail account is not created. Reason:".$create_mail_account_result;
}

echo $result;
```

Note that password strong policy is defined in WHM (Web Host Manager).

**2. Change existing email account password:**

```
$domain = "mywebsite.com";
$email_username = "john.doe";
$email_new_password = "mynewaccountpassword123$";

$change_password_result = 	Yii::$app->cpanelemailcreator->changeAccountPassword(
										$domain,
							            $email_username,
							            $email_new_password
							);

if($change_password_result) {
	$result = "Mail account password for ".$email_username." is changed.";
} else {
	$result = "Password is not changed. Reason:".$change_password_result;
}

echo $result;
```

**3. Change existing email account disk quota:**

```
$domain = "mywebsite.com";
$email_username = "john.doe";
$email_new_quota = "10000"; // in MB

$change_mail_quota_result = 	Yii::$app->cpanelemailcreator->changeEmailQuota(
										$domain,
							            $email_username,
							            $email_new_quota
								);

if($change_mail_quota_result) {
	$result = "Mail quota for ".$email_username." is changed to ".$email_new_quota." MB.";
} else {
	$result = "Mail quota is not changed. Reason:".$change_password_result;
}

echo $result;
```

**4. Deleting existing email account**

```
$domain = "mywebsite.com";
$email_username = "john.doe";

$delete_mail_result = 	Yii::$app->cpanelemailcreator->deleteMailAccount(
										$domain,
							            $email_username,
							            $email_new_quota
						);

if($delete_mail_result) {
	$result = "Mail account ".$email_username."@".$domain." is deleted.";
} else {
	$result = "Mail account is not deleted. Reason:".$change_password_result;
}

echo $result;
```

Resources
---------

[](#resources)

[Yii Framework Extension Page](http://www.yiiframework.com/extension/yii2-cpanel-email-creator/)

If you have any questions, feel free to ask!

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/filipajdacic-yii2-cpanel-email-creator/health.svg)

```
[![Health](https://phpackages.com/badges/filipajdacic-yii2-cpanel-email-creator/health.svg)](https://phpackages.com/packages/filipajdacic-yii2-cpanel-email-creator)
```

PHPackages © 2026

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