I was wondering if there was any scripts made or how to make a script that allows users to automatically add a email account, instead of me adding it everytime.

Also, is there any way of doing the same thing except for having a way to add subdomains dynamically?

    Waht am I doing wrong because its not working? ...

     <? 
     if($Submit) {
    ######################################## 
    ## CPanel e-mail adding script 
    
    ######################################## 
    ## Configuration, edit these values 
    $host = "civicspot.com"; # Change to your domain or CPanel host 
    $skin = "default"; # Change to the skin you use for CPanel 
    $user = "cspot"; # Change to your CPanel username 
    $pass = "xxxxx"; # Change to your CPanel password 
    $domain = "civicspot.com"; # Change to the domain you are adding an e-mail to. 
    $email = "$user1"; # Change to the e-mail account you are adding 
    $emailpass = "$user2"; # Change to the password for the new e-mail account 
    $quota = 10; # Change to the quota (in megabytes) to give to the new e-mail 
    
    ##################################################  ############ 
    ## Actual script, no more editing required 
    $fp = fsockopen($host, 2082); 
    $auth = $user.":".$pass; 
    $pass = base64_encode($auth); 
    $in = "GET frontend/x/mail/addpop2.html?email=$email&domain=$domain&password=$emailpass&quota=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass \r\n"; 
    
    fputs($fp,$in); 
    fclose($fp); 
    echo "worked";
    }
    ?>
    <form name="form1" method="post" action="<? $PHP_SELF; ?>">
      <input name="user1" type="text" id="user1">
      <input name="user2" type="text" id="user2">
      <input type="submit" name="Submit" value="Submit">
    </form>
      2 months later

      Hi,
      I've done a script to create aliases using a PEAR component (HTTP_Request), but it's lacking a lot of features, like: if it worked, list created accounts, created aliases and others.

      <?php
      
      include('Request.php');
      
      $edumail = 'eduardo.'.date("Gis"); // just to get something diff.
      
      $params = array( 'method' => 'POST',
                       'user' => 'mylogin',
                       'pass' => 'mypass'
                     );
      
      $a = &new HTTP_Request('http://www.mydomain.com.br:2082/frontend/portugues/mail/doaddfwd.html',$params); // get that info in the form in cpanel
      
      $a->addPostData('email', "$edumail");
      $a->addPostData('domain', 'mydomain.com.br');
      $a->addPostData('forward', 'eduardoellery@myotherdomain.com');
      
      $a->sendRequest();
      echo $a->getResponseBody();
      ?>
      
      Who wans to exchange some experience?
      
      bye!
        3 months later

        I found a AWESOME script for those that are in need of a cpanel email account.

        Visit lucidstorm.com and its called cpanelmail its awesome well worth $15!

          Write a Reply...