NamePros.Com (http://www.namepros.com/)
-   Programming (http://www.namepros.com/programming/)
-   -   Email Account Creator (http://www.namepros.com/programming/454227-email-account-creator.html)

crystak 04-06-2008 09:36 AM

Email Account Creator
 
Hello everyone!

I haven't been posting a lot on these forums but been surfing them frequently.

I am looking to make mini version of the hotmail/ yahoo mail with the same style of sign up pages for visitors. I own a basic dedicated server on Hostgator with WHM and CPanel and was told this is possible but I would need to hire a programmer. I don't have money to spare at the moment so I would like to do this myself.


I've read this post here (found it on 4th page of Google): http://www.namepros.com/code/133837...nt-creator.html and it seems to be what I am looking for but the download link is dead!

That script was created in 2005, is there a better more improved version of it somewhere? I would absolutely appreciate it if you could point me in the right direction, been looking for such a script for days and I promised my visitors I would sort it out by the end of next week
_\|/_ .

Tree 04-07-2008 12:22 PM

Here's a class I found on phpclasses.org:

cpmail_class.php:
PHP Code:
<?php
/*
This class 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

Class Name: cpmail
Clas Title: cPanel Mail Accounts Creator
Purpose: Create cPanel email account without loggin in to cPanel.
Version: 1.0
Author: Md. Zakir Hossain (Raju)
URL: http://www.rajuru.xenexbd.com

Company: Xenex Web Solutions
URL: http://www.xenexbd.com

License: GPL
You can freely use, modify, distribute this script. But a credit line is appreciated.

Installation:
see example.php for details

*/

//definding main class
class cpmail{
  
//declare public variables
  
var $cpuser;    // cPanel username
  
var $cppass;        // cPanel password
  
var $cpdomain;      // cPanel domain or IP
  
var $cpskin;        // cPanel skin. Mostly x or x2.
  
  //defining constructor
  
function cpmail($cpuser,$cppass,$cpdomain,$cpskin='x'){
    
$this->cpuser=$cpuser;
    
$this->cppass=$cppass;
    
$this->cpdomain=$cpdomain;
    
$this->cpskin=$cpskin;
    
// See following URL to know how to determine your cPanel skin
    // http://www.zubrag.com/articles/determine-cpanel-skin.php
  
}

  
//now create email account, function takes three arguments
  /*
  $euser = email id
  $epass = email password
  $equota = mailbox allocated size
  */
  
function create($euser,$epass,$equota){
    
$path="http://".$this->cpuser.":".$this->cppass."@".$this->cpdomain.":2082/frontend/".$this->cpskin."/mail/doaddpop.html?quota=".$equota."&email=".$euser."&domain=".$this->cpdomain."&password=".$epass;
    
$f = fopen($path,"r");
    if (!
$f) {
      return(
'Cannot create email account. Possible reasons: "fopen" function not allowed on your server, PHP is running in SAFE mode');
    }

    
//check if the account exists
    
while (!feof ($f)) {
      
$line = fgets ($f, 1024);
      if (
ereg ("already exists!", $line, $out)) {
        return(
'Such email account already exists.');
      }
    }
    
fclose($f);
    
//return success message
    
return "Email account created.";
}
}

?>


cpmail_example.php:
PHP Code:
<?php
/*
This is the example script for cpmail class
*/

?>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>cPanel Email Creator</title>
</head>

<body>

<p><b><font size="5">Cpanel Email Creator</font></b></p>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">

    <table border="0" width="52%" style="border-collapse: collapse">
        <tr>
            <td colspan="2">
            <p align="left"><b>Create Email Accounts</b></td>
        </tr>
        <tr>
            <td width="78">
            <p align="right">Username:</td>
            <td><input type="text" name="euser" size="20"></td>
        </tr>
        <tr>
            <td width="78">
            <p align="right">Password:</td>
            <td><input type="password" name="epass" size="20"></td>
        </tr>
        <tr>
            <td width="78">&nbsp;</td>
            <td><input type="submit" value="Create New Account" name="create"></td>
        </tr>
    </table>
</form>
<p>&nbsp;</p>
<?php
if(isset($_POST['create'])){

//include class file
require_once('cpmail_class.php');

/*
  instanceiate class & pass three arguments cpanelusername, cpanelpassword,yourdomainname,cpanelskin
  See following URL to know how to determine your cPanel skin
  http://www.zubrag.com/articles/determine-cpanel-skin.php
  if you don't pass cpanelskin argument, default will be x
*/
$cpanel=new cpmail("rubdnet","secret2001","rubd.net","rvblue");

//call create function and you have to pass three arguments as follows:
//emailid, password, quota

echo $cpanel->create($_POST['euser'],$_POST['epass'],"20");
}
?>
</body>

</html>


Not sure if these work or not, just something I've found.

BMFX 04-07-2008 02:29 PM

Ummm.... I have this script laying around on my host, I have sold a few different sites like this let me see if i can fish it up and find for you.

- John

crystak 04-08-2008 10:02 AM

Originally Posted by BMFX
Ummm.... I have this script laying around on my host, I have sold a few different sites like this let me see if i can fish it up and find for you.

- John


That would be great, thanks!


All times are GMT -7. The time now is 07:50 PM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0