Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    2

    Default Cpanel doaddpop problem

    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. #2
    Member
    Join Date
    Jul 2004
    Posts
    6

    Default $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

Similar Threads & Tags
Similar threads

  1. doaddpop hook?
    By dorris in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-16-2008, 05:32 AM
  2. Cpanel/WHM problem, Exim problem, Mail problem
    By iroku in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 08-18-2006, 04:28 PM
  3. Working doaddpop Script.
    By blue44 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-01-2005, 04:18 AM
  4. doaddpop and doadddomain via php
    By mickie2000 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-03-2004, 07:11 PM
  5. Replies: 0
    Last Post: 03-23-2004, 06:20 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube