PHP Classes

PHP cPanel API Email Manager: Create and manage email accounts using cPanel API

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 338 All time: 7,076 This week: 95Up
Version License PHP version Categories
cpmm 1.0Free To Use But R...5Email, PHP 5, Web services, Hosting


This class can create and manage email accounts using the cPanel API.

It can send HTTP requests to the cPanel API of a hosting account to perform several types of operations to manage email accounts.

Currently it can check if a given email account exists, create a new email account, get the list of created email accounts, change the password of an email account and delete an email account.

Picture of Rob
Name: Rob <contact>
Classes: 3 packages by
Country: United States United States
Age: 35
All time rank: 2655365 in United States United States
Week rank: 524 Up55 in United States United States Up


<!DOCTYPE html>
        <meta charset="UTF-8">
        <title>cPanelMailManager Example</title>
            .wrapper{width:70%; display:block; margin: 0 auto; font-family:monospace;}
        <div class="wrapper">

// include the library

// cPanel domain or IP
$host = "";

// cPanel Username
$user = "cPanel_Username";

// cPanel Password
$pass = "cPanel_Password";
$host == ""){
"Put your cPanel credentials in and remove line ".__LINE__." from the example script before running."; exit;

// initialize the class
$cpmm = new cPanelMailManager($user, $pass, $host);

// Create a new email address
$email = "";
$password = "mybadpassword";
$result = $cpmm->createEmail($email,$password);
"Email ($email) ".($result ? "successfully" : "not")." created.<br />";

// Check if an email exists
$email = "";
$result = $cpmm->emailExists($email);
"Email ($email) ".($result ? "does" : "does not")." exist.<br />";

// Change an email password
$email = "";
$newPassword = "mybetterpassword";
$result = $cpmm->changePW($email,$newPassword);
            echo (
$result ? "Changed" : "Could not change")." password for email $email.<br />";

// Delete an email account
$email = "";
$result = $cpmm->deleteEmail($email);
            echo (
$result ? "Deleted" : "Could not delete")." email account $email.<br />";

// List email accounts
$pageSize = 15;
$pageNo = 1;
$result = $cpmm->listEmails($pageSize, $pageNo);


  Files folder image Files  
File Role Description
Plain text file class.cpmm.php Class Base Library for cPanel email APIs
Plain text file example.php Example Examples of the cPanelMailManager Library

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:7,076
This week:95Up