Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Sep 2002
    Posts
    53

    Exclamation Automatic email creation script

    For sometime ago I have been using this php code to create email accounts automatically - this code is not my own, one programmer made it using something similar that he found on this dboard. It used to be working just fine until recently.

    Probably after some Cpanel upgrade it is no longer working.

    Here is the code:

    PHP Code:
    $host "www.my_domain_name.com";
    $socket fsockopen($host,2082);
    $cuser "username";
    $cpassword "password";
    $authstr "$cuser:$cpassword";
    $pass base64_encode($authstr);
    $in "GET /frontend/x/mail/doaddpop.html?email=$username&domain=my_domain_name.com&password=$password&quota=$cquo HTTP/1.0\r\nAuthorization: Basic $pass \r\n";
    fputs($socket,$in);
    fclose$socket ); 
    Any idea why it is no longer working?

    Thanks!

    Tomas

  2. #2
    Member
    Join Date
    Sep 2002
    Posts
    53

    Default

    Someone has to know this...right?

    Tomas

  3. #3
    Member
    Join Date
    Sep 2002
    Posts
    53

    Default

    It looks like I found the problem thanks to another post at this dboard.

    The correct part of the code that did not work is:

    PHP Code:
    $in "GET /frontend/x/mail/doaddpop.html?email=$username&domain=my_domain_name.com&password=$password&quota=$cquo HTTP/1.0\r\nHost:my_domain_name.com&\r\nAuthorization: Basic $pass \r\n"
    It is apparent that it happened because Cpanel changed something because it used to be working without it. To CPanel admin: please avoid similar changes in the future if at all possible... or at least let us know.

    Thanks!

    Tomas

  4. #4
    Member
    Join Date
    Aug 2004
    Posts
    6

    Angry

    Hi man.

    I'm using your code, because i need to create one e-mail account using PHP... but the problem is that the code works, but no new e-mail account appears on the CPanel...

    Don't know whats wrong, i will put my code, then i wait for someone to help me!

    Code:
    <?
    $host = "ilumination.com"; 
    $socket = fsockopen($host,2082); 
    $cuser = "CPanel User Name"; 
    $cpassword = "CPanel Password"; 
    $authstr = "$cuser:$cpassword"; 
    $pass = base64_encode($authstr); 
    $username = "testmail";
    $password = "testmail2";
    $cquo = 10;
    $domain="ilumination.com";
    $in = "GET /frontend/x/mail/doaddpop.html?email=$username&domain=$domain&password=$password&quota=$cquo HTTP/1.0\r\nHost:$domain&\r\nAuthorization: Basic $pass \r\n"; 
    echo $in;
    fputs($socket,$in); 
    fclose( $socket ); 
    ?>
    Do you think you can help me ? Thank you!

  5. #5
    Member
    Join Date
    Mar 2003
    Location
    Louisiana
    Posts
    101

    Default

    Ok, are you actually using the x theme? If not, change it to the theme that you are using and then try.

  6. #6
    Member
    Join Date
    Aug 2004
    Posts
    6

    Default

    cPanel Version 9.4.1-RELEASE
    cPanel Build 64
    cPanel Theme cPanel X v1.7
    This is the information that i have on the CPanel... so im using X Theme, right ?
    So why this won't work ?


    I appreciate your help!
    tk u...

Similar Threads & Tags
Similar threads

  1. Automatic DB creation script
    By rbro in forum cPanel Developers
    Replies: 1
    Last Post: 05-26-2008, 10:23 AM
  2. Automatic Account Creation Script
    By TitaniumHosting in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-12-2005, 08:08 AM
  3. automatic account creation script.
    By edkeyte in forum cPanel Developers
    Replies: 0
    Last Post: 01-29-2005, 01:37 AM
  4. Script for automatic user creation
    By Dani_CH in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-13-2005, 12:54 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube