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.

Cpanel doaddpop problem

Discussion in 'General Discussion' started by chriswatson, Jan 2, 2004.

  1. chriswatson

    chriswatson Registered

    Joined:
    Dec 26, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi all,

    I have a PHP script which creates a pop3 mail account using the doaddpop in cpanel. Here is the code that should create the pop3 account-

    <?
    $host = "www.my-domain.co.uk";
    $socket = fsockopen($host,2083);
    $cuser = "MyUserName";
    $cpassword = "MyPassword";
    $authstr = "$cuser:$cpassword";
    $pass = base64_encode($authstr);
    $in = "GET /frontend/bluelagoon/mail/doaddpop.html?email=testuser&domain=my-domain.co.uk&password=testpass&quota=20
    HTTP/1.0\r\nAuthorization: Basic $pass \r\n";
    fputs($socket,$in);
    fclose( $socket );
    ?>

    When i run the script i receive no error message, but when i check cpanel NO email account is created!!!

    My host is Klooki.net
    My cpanel version is 8.5.5-EDGE 57
    My cpanel theme is Bluelagoon cPanel X v2.2.6

    Anyone know how i can get the above code to work or what the problem may be ?

    Thanks for your help

    Chris.
     
  2. chimeraonline

    chimeraonline Member

    Joined:
    Jul 2, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    $host,$socket error

    $host = "www.my-domain.co.uk";
    $socket = fsockopen($host,2083);

    should be:

    $host = "my-domain.co.uk";
    $socket = fsockopen($host,2082);

    that is the only major difference between what you have and what I have that works:

    I also use:
    $sAuth = base64_encode("".$cpusername.":".$cppassword."");

    instead of:
    $authstr = "$cuser:$cpassword";
    $pass = base64_encode($authstr);

    to encode the username and password for cpanel
     
Loading...

Share This Page