The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Automatic email creation script

Discussion in 'E-mail Discussions' started by tomfra, Feb 22, 2004.

  1. tomfra

    tomfra Well-Known Member

    Joined:
    Sep 30, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    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:
    $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. tomfra

    tomfra Well-Known Member

    Joined:
    Sep 30, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    Someone has to know this...right?

    Tomas
     
  3. tomfra

    tomfra Well-Known Member

    Joined:
    Sep 30, 2002
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    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:
    $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. AcId_Bl0oD

    AcId_Bl0oD Member

    Joined:
    Aug 10, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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. __DoPe_ShOw__

    __DoPe_ShOw__ Well-Known Member

    Joined:
    Mar 8, 2003
    Messages:
    99
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Louisiana
    Ok, are you actually using the x theme? If not, change it to the theme that you are using and then try.
     
  6. AcId_Bl0oD

    AcId_Bl0oD Member

    Joined:
    Aug 10, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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...
     
Loading...

Share This Page