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.

CPanel POP3 mailbox autocreation !!!

Discussion in 'cPanel Developers' started by chr_nikol, Nov 5, 2004.

  1. chr_nikol

    chr_nikol BANNED

    Joined:
    Aug 16, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    Hello,
    i will be short and clear.

    I have a site that provides free email services like yahoo or hotmail does.

    I want to make a php script that will automatically add new pop3 mail users on my account!

    How this can be done ?

    From cpanel they said i can use:
    /usr/local/cpanel/cpanel-email
    but i tried and can't make it work !!!

    Any help guys would be great !!!
     
  2. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    It can't be done by cross-posting. :mad:
     
  3. Q-IS

    Q-IS Registered

    Joined:
    Oct 10, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    I don't know if this is agains the rules, but here's a PHP script that can create POP3 emails with a form:

    <?php
    // Change this:

    $user_domain="domein.ext"; // Your domain, no www, http:// and / at the end!!!
    $user_cpanel="domein"; // Cpanel username
    $user_pass="demo"; // Cpanel password
    $user_theme="x"; // Cpanel theme (afhter /frontend/)

    // Warning: Be careful with the code under this line!


    function create_acct($acct, $domain, $meg, $mpassword, $cpaneluser, $cpanelpass, $user_theme) {
    $o = "http://$cpaneluser:$cpanelpass@$domain:2082/frontend/".$user_theme."/mail/doaddpop.html?email=$acct&domain=$domain&password=$mpassword&quota=3";
    $tester = @file($o);
    return " DONE!<br>";
    }

    function remove_acct($acct, $domain, $cpaneluser, $cpanelpass, $user_theme) {
    $o = "http://$cpaneluser:$cpanelpass@$domain:2082/frontend/".$user_theme."/mail/realdelpop.html?email=$acct&domain=$domain";
    $tester = @file($o);
    return " DONE; Email deleted<br>";
    }

    if ($_POST['make'])
    {
    echo create_acct($_POST['acct'],$user_domain,$_POST['megs'],$_POST['pass'],$user_cpanel,$user_pass, $user_theme);
    }
    elseif ($_POST['remove'])
    {
    echo remove_acct($_POST['acct'],$user_domain,$user_cpanel,$user_pass, $user_theme);
    }
    ?>
    <html>

    <head>
    <meta http-equiv="Content-Language" content="nl">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Create POP3 account</title>
    </head>

    <body>

    <form method="POST" action="<? echo $PHP_SELF; ?>">
    <p>username <input type="text" name="acct" size="20">@<? echo $user_domain; ?></p>
    <p>password <input type="text" name="pass" size="20"> (not neccesary when deleting)</p>
    <p>megs <input type="text" name="megs" size="20"> (not neccesary when deleting)</p>
    <p><input type="submit" value="make" name="make"><input type="submit" value="remove" name="remove"><input type="reset" value="Clear" name="B2"></p>
    </form>

    </body>

    </html>
     
  4. hasif

    hasif Member

    Joined:
    Nov 13, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    pls... help me

    Hi,

    I want CPanel Sub-Domain autocreation pls....!!!!!

    :confused: Thanks in advance.
     
Loading...

Share This Page