Dream House

Courage to do something…

Archive for the 'Miscellaneous' Category


cPanel: Class for creating email account and mail forwarder

Posted by Mohammad Sajjad Hossain on 15th July 2008

This class can be used to create email account and mail forwarders using PHP, without logging to cPanel. It is an extension of script made by www.zubrag.com. You can access the original link from here http://www.zubrag.com/scripts/cpanel-create-email-account.php. And it is also a modified version of the class “cpmail” which was coded by Md. Zakir Hossain (Raju), http://www.rajuru.xenexbd.com. How to configure:

  1. Download the zipped file.
  2. Unzip the file. This file contains the class file and an example file.
  3. Open the class file and change these variables -
    • $currentTheme - Your cPanel theme
    • $userName - Your cPanel user name
    • $password - Your cPanel password
    • $domain - Your cPanel domain
    • $cPanelPort - Your cPanel port [optional]
  4. Include the class in the file where you want to use it.

Example:

// include the class file
include('class.cpmailmanager.php');
 
// create an instanse of the class
$cp = new CPMailManager();
 
// create an email account
$cp->createEmail('sadat', 'sadat123', 10);
 
if($cp->status) //account created successfully
{
     echo 'Mail created successfully';
}
else
{
     echo $cp->message;
}
 
// create mail forwarder
$cp->createForwarder('sadat', 'msh@example.com');
echo '<br />' . $cp->message;
 
// delete mail forwarder
$cp->deleteForwarder('sadat', 'msh@example.com');
echo '<br />' . $cp->message;
 
// delete email account
$cp->deleteEmail('sadat');
echo '<br />' . $cp->message;

download cPanel: Class for creating email account and mail forwarder

Share/Save/Bookmark

Posted in DOMPDF, Miscellaneous, My Works, PHP | 1 Comment »

Upgraded my site to latest version of WordPress

Posted by Mohammad Sajjad Hossain on 28th June 2008

For some days I was thinking to update my site to latest version of WordPress. But I was not sure how much time will take to complete the task and what complexity I will have to face.

Today is my holiday and I am a little bit free today. So, I decided to upgrade my WordPress setup. Taking a deep breath I started reading the “Upgrading WordPress - Three Step Upgrade guide. Followed the instruction carefully and within half an hour I was able to upgrade it successfully. I found this process very easy and less time consuming.

Thanks WordPress!

Share/Save/Bookmark

Posted in Miscellaneous | 1 Comment »

Happy New Year 2008

Posted by Mohammad Sajjad Hossain on 5th January 2008

Happy New Year 2008

Share/Save/Bookmark

Posted in Miscellaneous | 1 Comment »