Results 1 to 8 of 8
  1. #1

    Automatic Email Creation

    Dear Friends,

    I want to give free email accounts to my site members,
    I want to know is there any script or software which
    will do this automatically,

    "Automatically Creating Email Accounts in cpanel"

    Appreciate response.

    Thanking You

    Hyder Abbas

  2. #2
    Join Date
    Mar 2004
    well there are programs (php scripts) which allow you to do just the same.... many are free...

    check your local script directory :p,

    Testing 1.. Testing 1..2.. Testing 1..2..3...

  3. #3
    If you really get stuck, let me know, i think using a bit of php and curl with some security checks could create what you need.

    I belive plesk has a API to do it, however on cPanel, with php and curl you could simulate a login and submissin of the form.
    Note to self: Add something funny!
    Search is your friend!

  4. #4
    Join Date
    Jun 2004
    Bay Area -USA
    It's pretty easy to do stuff in cpanel.

    What you're gonna do is something like this.

    This example is what I use to automatically create a subdomain.

    PHP Code:
    //create sub-domain

    $login "xxxxx";
    $pass "xxxxxxx";
    $domain "";
    $subdomain $_GET['user'];
    $output fopen ("http://$login:$pass@[url]www.[/url]$domain:2082/frontend/x/subdomain/doadddomain.html?domain=$subdomain&rootdomain=$domain""r"); 
    Once you see how that works, you can just go add an email in cpanel, copy the URL and the params in the URL and set the script up like the above.

    Hope that helps.
    <<< Please see Forum Guidelines for signature setup. >>>

  5. #5
    I would recomend using curl to do it, kinda like the above example, but with cUrl and not fopen.

    Also tryansmit the data over SSL to be sure its safe.

    And dont forget to put plenty of checks in to stop it getting abused.
    Note to self: Add something funny!
    Search is your friend!

  6. #6
    Join Date
    Nov 2004
    No-one has addressed the issue of spammers. Spammers just love services like yours, and unless you can stop them, you'll be on every blocking list north of the south pole within weeks. Be very careful with providing free email accounts to everyone, especially if you don't check bona fides.

  7. #7
    Join Date
    Oct 2004
    I am using below code right now. It works well, however I am going to write one with cURL, which is neater...

    But as others said, Beware!!
    you are going to offer mail accounts free AND automaticly created ??
    That sound like spammer festa

    PHP Code:
    "mydomain"# Change to your domain or CPanel host
    $skin "rvblue"# Change to the skin you use for CPanel
    $user "usrname"# Change to your CPanel username
    $pass "mypass"# Change to your CPanel password
    $domain ""# Change to the domain you are adding an e-mail to.
    $email "test"# Change to the e-mail account you are adding
    $emailpass "test"# Change to the password for the new e-mail account
    $quota 100# Change to the quota (in megabytes) to give to the new e-mail

    $fp fsockopen($host2082);
    $auth $user.":".$pass;
    $pass base64_encode($auth);
    $in "GET /frontend/$skin/mail/doaddpop.html?email=$email&domain=$domain&password=$emailpass&quota=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass \r\n";

    $out fgets($fp)){ echo "$out<BR>"; } #Not necessary, only to see the results...
    Closed for winter...

  8. #8
    Join Date
    Nov 2004
    Actually, one simple way to check bona fides is to use the maxmind service. It can check IPs for known spammer sources, and determine whether existing email addresses are free (which may not be as relevant to you).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts