Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 14 of 14
  1. #1
    Member
    Join Date
    Feb 2004
    Posts
    6

    Question Automatic Creation of E-mail Accounts

    I've tried the posted scripts here to create an e-mail account within cPanel but none of them work for me. The server is running cPanel Build 8.8.0-RELEASE 10 and I don't know if this will help out any, but in the left information section (in the x theme), it says "cPanel Pro 0.9.9.2 (RC8)". Is there any code that could be useful? I've tried the following:
    PHP Code:
    <?php
    $authstr 
    "$cpaneluser:$cpanelpass";
    $pass base64_encode($authstr);
    $in "GET /frontend/x/mail/doaddpop.html?email=$acct&domain=$domain&password=$mpassword&quota=$meg\r\n HTTP/1.0\r\nAuthorization: Basic $pass \r\n";
    $socket fsockopen($host,2082);
    fputs($socket,$in);
    fclose($socket);
    ?>

  2. #2
    Member Jemshi's Avatar
    Join Date
    Sep 2003
    Location
    India
    Posts
    217

    Default

    try the search button on the forum. I remember someone discussing this earlier.
    Jemshad O K
    Sys Admin
    Bobcares.com
    http://www.poornam.com
    Winners don't do different things. They do things differently

  3. #3
    Member
    Join Date
    Feb 2004
    Posts
    6

    Default

    It's OK. I figured it out myself. I did a function where it calls the page on the server to create it instead of doing the socket connection. Thanks anyway, I guess I should have posted it earlier. I have it set up on http://www.drewtemp.com Take a look if you please and you can sign up for an e-mail account at drewtemp.com or rapocity.us

  4. #4
    Member Jemshi's Avatar
    Join Date
    Sep 2003
    Location
    India
    Posts
    217

    Default

    congrats !

    :-)
    Jemshad O K
    Sys Admin
    Bobcares.com
    http://www.poornam.com
    Winners don't do different things. They do things differently

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    4

    Default

    why not post the working code?

  6. #6
    Member
    Join Date
    Sep 2003
    Location
    Poland
    Posts
    24

    Default

    That would be nice

  7. #7
    Member
    Join Date
    Feb 2004
    Posts
    6

    Default

    Here is the code :

    PHP Code:
    <?php
    function create_acct($acct$domain$meg$mpassword$cpaneluser$cpanelpass) {
        
    $o "http://$cpaneluser:$cpanelpass@$domain:2082/frontend/x/mail/doaddpop.html?email=$acct&domain=$domain&password=$mpassword&quota=$meg";
        
    $tester = @file($o);
    }

    function 
    remove_acct($acct$domain$cpaneluser$cpanelpass) {
        
    $o "http://$cpaneluser:$cpanelpass@$domain:2082/frontend/x/mail/realdelpop.html?email=$acct&domain=$domain";
        
    $tester = @file($o);
    }
    ?>
    Replace "x" with the theme you are using for cPanel.

  8. #8
    Member
    Join Date
    Sep 2003
    Location
    Poland
    Posts
    24

    Default

    hmmmm... a question...

    Will that work with the ne IE fix?? As far as I know http://userasswd@domain.com:2082/..... doesn't work anymore (at least after updating iE). Or am I wrong?

    Thank BTW
    D.

  9. #9
    Member
    Join Date
    Feb 2004
    Posts
    6

    Default

    Doesn't open through IE. Opens that file through the server-side and not on the client side.

  10. #10
    Member
    Join Date
    Jun 2003
    Posts
    396

    Default

    This worked for me! New IE does not matter
    -Albert

  11. #11
    Registered User
    Join Date
    Feb 2004
    Posts
    4

    Default

    Okay I went to your site and borrowed your form and im gonna try this out but would I just save the php part as a php file then
    <form method="post" action="makemail.php?action=make_email">
    ?

  12. #12
    Member
    Join Date
    Feb 2004
    Posts
    6

    Default

    I recommend you do an activation for a user to validate his/her account. If you do not validate it, it could attract spammers and then your domain name will become in people's "Junk Mail" folder. Once the form is submitted, send it to a page that will insert a certain get that is md5 encrypted and use that as a key. I run a cron every day about about 3:00am CST so if the user has not yet activated their account in 2 days, then it will be removed from the database and they will have to verify it again. On the page that does the activation, do it where it will update you "active" field in the database to a "1" and everything. I will upload a script on my site for download some time so you can download it once I do that. Thanks for all of your responses. You may use this code freely all you want, it was very simple and is easier than doing the socket connection.

  13. #13
    Member quasiman's Avatar
    Join Date
    Aug 2003
    Location
    Portland, Oregon
    Posts
    10

    Default

    I would really appreciate a download of this!! I tried to use your script, but I'm not sure exactly how to implement it...it looks like there's two scripts there; one for adding an account, one for removing the account. So how would I use a form to post to only one of those?
    Quasitown Internet Services
    Unlimited Disk Space / Bandwidth
    Reseller Program
    http://www.quasitown.com

  14. #14
    Member Roy@ENHOST's Avatar
    Join Date
    Mar 2002
    Location
    Los Angeles California
    Posts
    495

    Default

    I saw this on your site:
    If there is numerous e-mails coming from your account, your account will be removed without warning.

    Did you have a script to detect that?
    If you do that is real neat.

    Anyway there was an account activation error when I tried to activate my account:

    Parse error: parse error in /home/drewtemp/public_html/modules/Email/activate.php on line 22

    Originally posted by drewtemp
    It's OK. I figured it out myself. I did a function where it calls the page on the server to create it instead of doing the socket connection. Thanks anyway, I guess I should have posted it earlier. I have it set up on http://www.drewtemp.com Take a look if you please and you can sign up for an e-mail account at drewtemp.com or rapocity.us
    Last edited by Roy@ENHOST; 04-06-2004 at 10:46 PM.
    = = = = = = = = = = = = = = = = = =
    Cpanel XP Evolution (Add DOZENS of functions to your Cpanel NOW!!!) - 21 Languages, User Friendly Interface, Feature Enabled, Highly Customizable, Create Popup Once window, Language Aware, Flash Tutorials, Theme Changer,Integration with Modernbill,WHM AutoPilot,ClientExec,LPanel&WHOISCart

Similar Threads & Tags
Similar threads

  1. how to :automatic account creation ?
    By sanzeeb in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-13-2007, 03:18 AM
  2. automatic email accounts creation
    By pisicosu in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 09-19-2006, 05:27 AM
  3. Automatic Mail Creation
    By scottyuk in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-24-2003, 02:08 PM
  4. Automatic Creation of WHM Accounts
    By DaVeKH in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 11-18-2003, 02:44 PM
  5. Automatic account creation? is there a way?
    By wonderboy in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-11-2003, 06:41 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube