CPanelEmailAccountManager is a project mainly written in ..., it's free.
PHP5 class to easily create and delete email accounts on hosts running cPanel from within your web application
author: Bryce Mickler [email protected] version: 1.0 copyright: 2009 license: http://www.freebsd.org/copyright/freebsd-license.html Free BSD License download: http://github.com/bmickler/cPanelEmailAccountManager
This class provides methods to create and delete email accounts by using cPanel's built-in functionality.
This class is based on the scripts authored by Md. Zakir Hossain (Raju) (http://www.rajuru.xenexbd.com) which, in-turn, were based on the scripts from http://www.zubrag.com/scripts/cpanel-create-email-account.php.
[begin file] example.php
<?php
require_once('class.cPanelEmail.php');
$args['cpUser'] = 'username'; // Your cPanel username $args['cpPassword'] = 'pass12345'; // Your cPanel password $args['cpDomain'] = 'example.com'; // Your domain name (sans the www.) $args['cpSkin'] = 'x3'; // Skin version of your cPanel install $args['useHttps'] = true; // Whether or not to use https://
$cPanelEmailMgr = new cPanelEmailMgr($args);
// Create '[email protected]' with a mailbox diskspace quota of 20MB if(!$cPanelEmailMgr->createAccount('test','example.com',20)) { die('could not create account'); }
// Delete the '[email protected]' email account if(!$cPanelEmailMgr->deleteAccount('test','example.com')) { die('could not delete account'); }
?>
[end file]
Q: 'What skin should I choose?', A: check out this article: http://www.zubrag.com/articles/determine-cpanel-skin.php
Q: 'Where can I get more help with this class?', A: http://www.brycemickler.com/forums/
todo verify that this works with cPanel skins other than x, x2, and x3