Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    1

    Exclamation Email Account Registration without cpanel login!

    Is there any one can help PHP Script to register email account without cpanel login?
    I tried this PHP scripts. I can use only one day. That scripts doesn't work on next day
    Who can help me??????
    <?
    if ($submit){
    $host = "CPanel IP";
    $port = 2083;
    $path = "/frontend/rvblue/mail/doaddpop.html";


    $cpaneluser = "user name";
    $cpanelpass = "cpanel password";
    $authstr = "$cpaneluser:$cpanelpass";
    //****************************


    $pass = base64_encode($authstr);


    $formdata = array ( "email" => $email, "domain" => $host, "password" => $password, "quota" => $quota);

    foreach($formdata AS $key => $val){
    $poststring .= urlencode($key) . "=" . urlencode($val) . "&";
    }

    $poststring = substr($poststring, 0, -1);

    $fp = fsockopen($host, $port, $errno, $errstr, $timeout = 30);

    if(!$fp){

    echo "$errstr ($errno)\n";

    }else{



    fputs($fp, "POST $path HTTP/1.1\r\n");
    fputs($fp, "Host: $host\r\n");
    fputs($fp, "Authorization: Basic $pass \r\n");
    fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
    fputs($fp, "Content-length: ".strlen($poststring)."\r\n");
    fputs($fp, "Connection: close\r\n\r\n");
    fputs($fp, $poststring . "\r\n\r\n");

    fclose($fp);
    }
    print "Account Created";
    }else{

    ?>
    <form method="post">
    Username:<input type="text" name="email"><br>
    Password:<input type="password" name="password"><br>
    Quota:<input type="text" name="quota">
    <input type="submit" name="submit" value="true">
    <? } ?>

  2. #2
    Registered User
    Join Date
    Oct 2004
    Posts
    2

    Default Looking for something similar.

    I'm looking for something similar. I want ot have user use their cPanel created email/passwords to login to a web portal. This would allow them to use one login/pswd rather than storing a new login/password in a database.

    It sounds like we are both looking for similar things.

    Matt

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    2

    Default

    I'm looking also. I hope someone will answer our question..

  4. #4
    Registered User
    Join Date
    Nov 2006
    Posts
    1

    Default Creating Mail Accounts Through cPanel with PHP

    Try this:

    $f = fopen ("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddpop.html?email=$account&domain=$domain&password=$password&quota=$quota", "r");
    if (!$f) {
    return FALSE;
    } else {
    while (!feof ($f)) {
    $line = fgets ($f, 1024);
    if (ereg ("already exists", $line, $out)) {
    return $line;
    break();
    }
    }
    fclose($f);
    }
    retrun TRUE;

    Where $cpuser, $cppass, $cpdomain relate to your cPanel account, and $cpskin is the skin you use (usually 'x' or 'x2' - check your URL), and $account, $domain, $password and $quota specify the account you want to create (e,g, $account='yourname', $domain='yourdomain.com' to create the address 'yourname@yourdomain.com'). The quota is in megs, 10 or 20 are usual numbers.

Similar Threads & Tags
Similar threads

  1. Account will not login to cPanel using https:// but will login with http://
    By wyattbiker in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 02-04-2011, 03:15 PM
  2. Customer Registration Email
    By westside in forum E-mail Discussions
    Replies: 2
    Last Post: 03-17-2006, 12:32 PM
  3. How Can i Login my email account without login to cpanel?
    By aljoher in forum E-mail Discussions
    Replies: 2
    Last Post: 08-29-2004, 08:51 PM
  4. User Account Registration
    By Sloppy in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-13-2004, 05:39 PM
  5. email registration script for cpanel/whm
    By vinc3nzo in forum E-mail Discussions
    Replies: 1
    Last Post: 06-09-2004, 11:24 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube