Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Manually creating new email accounts

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

  1. TCSLEA

    TCSLEA Active Member

    Joined:
    Oct 29, 2003
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    156
    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:
    506
    Likes Received:
    4
    Trophy Points:
    168
    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);

    ?>
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. TCSLEA

    TCSLEA Active Member

    Joined:
    Oct 29, 2003
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    156
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice