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.

Manually creating new email accounts

Discussion in 'E-mail Discussions' started by TCSLEA, Dec 4, 2003.

  1. TCSLEA

    TCSLEA Active Member

    Joined:
    Oct 29, 2003
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austin, T E X A S
    A new project I need to tackle is figuring out how to create new user email accounts manually, without going through cPanel. I want to create them the same way cPanel does, because I want everything to stay compatible with cPanel. It's just that I need a script to create the email accounts automatically, which is why I can't use the cPanel interface.

    If anyone else has accomplished this, or made any progress on it, I'd love to hear from you before I get started. It doesn't sound too difficult, but what may be time consuming is figuring out the locations of all the new/changed files.

    Thanks,
    Chris
     
  2. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    Does this help

    <?php
    $cpaneluser = "username";
    $cpanelpass = "password";

    // add a new mail account - change to suite
    $quota = "10";
    $password = "password";
    $newemail = "newemail';
    $domain = "yourdomain.com";

    $addpop = "http://$cpaneluser:$cpanelpass@localhost:2082/frontend/$cpaneltheme/mai
    l/doaddpop.html?email=$newemail&domain=$domain&password=$password&quota=$quota";

    $results = fopen($addpop,2);

    ?>
     
  3. TCSLEA

    TCSLEA Active Member

    Joined:
    Oct 29, 2003
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austin, T E X A S
    I will test it, but it sure looks like just the thing I was looking for. The script is all in PHP, so this will fit the bill just perfectly. Thanks so much for posting it!

    Would I, by chance, need to add the $cpaneltheme variable up top, like the user/pass variables?

    Chris
     
    #3 TCSLEA, Dec 4, 2003
    Last edited: Dec 4, 2003
Loading...

Share This Page