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.

adding email accounts with php script

Discussion in 'E-mail Discussions' started by tundra96, Jul 8, 2003.

  1. tundra96

    tundra96 Active Member

    Joined:
    Jun 24, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    0
    I'm trying to add email accounts for users using this code



    PHP:
    $host "www.SpamClear.com";
    $socket fsockopen($host,2082);
    $cuser "myusername";
    $cpassword "mypassword";
    $authstr "$cuser:$cpassword";
    $pass base64_encode($authstr);
    $in "GET /frontend/default/mail/addpop.html?email=$username&domain=SpamClear.com&password=$password&quota=$cquo HTTP/1.0\r\nAuthorization: Basic $pass \r\n";
    fputs($socket,$in);
    fclose$socket );
    But it does not want to add the accounts, anyone no whats wrong ?

    We have the latest version of cpanel, and I removed my username and password from the code above

    Thanks

    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:
     
  2. HostIt

    HostIt Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    18
    First thing that comes to mind (at a *very* basic level) is to be sure that account is using the 'default' cpanel theme.

    cPanel.net Support Ticket Number:
     
  3. tundra96

    tundra96 Active Member

    Joined:
    Jun 24, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    0
    It's using the default

    cPanel.net Support Ticket Number:
     
  4. tundra96

    tundra96 Active Member

    Joined:
    Jun 24, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    0
    Can anyone elase help with this ? please :(

    cPanel.net Support Ticket Number:
     
  5. dwayrynen

    dwayrynen Member

    Joined:
    Jun 19, 2002
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Try to POST the url to doaddpop.html rather then GET it from addpop.html.

    :)

    ie

    in = "POST /frontend/default/mail/doaddpop.html?email=$username&domain=SpamClear.com&password=$password&quota=$cquota HTTP/1.0\r\nAuthorization: Basic $pass \r\n";


    Darin

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page