Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jun 2003
    Posts
    33

    Default adding email accounts with php script

    I'm trying to add email accounts for users using this code



    PHP Code:
    $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. #2
    Member
    Join Date
    Feb 2003
    Posts
    191

    Default Re: adding email accounts with php script

    Originally posted by tundra96
    But it does not want to add the accounts, anyone no whats wrong ?
    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. #3
    Member
    Join Date
    Jun 2003
    Posts
    33

    Default

    It's using the default

    cPanel.net Support Ticket Number:

  4. #4
    Member
    Join Date
    Jun 2003
    Posts
    33

    Exclamation

    Can anyone elase help with this ? please

    cPanel.net Support Ticket Number:

  5. #5
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Jun 2002
    Posts
    22

    Default

    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:

Similar Threads & Tags
Similar threads

  1. creating email accounts php script that works with cpanel, is it possible?
    By technicolor in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-30-2006, 06:23 AM
  2. Help With php auction Script Please - Adding Fees
    By simplysites in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-20-2004, 03:55 AM
  3. Adding Email accounts using an external script, yet again
    By Pedro Monteiro in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 07-16-2004, 06:20 AM
  4. adding php script to /scripts
    By christi1 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-29-2004, 09:16 AM
  5. How could I write a PHP script to create email accounts?
    By N9ne in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 04-19-2003, 08:30 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube