07-30-2011, 11:00 PM
Today I needed bulk email ids and wanted to make use of my throwaway domains for it. So, I wrote up with a script for it. It can be very useful to each of you here too. Almost every tool supports cpanel email accounts (they can be accessed via POP like any other regular email accounts like gmail, yahoo, etc.). But these will be self-hosted email accounts you don't have to fear and risk getting them banned like for other email providers. Also you don't have to spend on captchas or buy accounts from providers. This script can be used to make accounts on bulk (as many you want but don't make more than 1000 at a time). Read the instructions, enter proper details, save it as whatever.php, upload it on your server (or run it from localhost using WAMP) and run it in the browser. It will output email ids and password after account creation is successful.
PHP Code:
<?php
set_time_limit(0);
// cPanel info
$cpuser = 'cpaneluser'; // cPanel username
$cppass = 'cpanelpass'; // cPanel password
$cpdomain = 'domain.com'; // cPanel domain or IP
$cpskin = 'x3'; // cPanel skin. Mostly x or x2.
// Read here to know how to check cPanel skin - http://www.zubrag.com/articles/determine-cpanel-skin.php
$epass = 'emailpassy'; // email password
$edomain = 'emaildomain.com'; // email domain (usually same as cPanel domain above)
$equota = 50; // amount of space in megabytes
// Email format - {prefix}{number}@{domain.tld}
$prefix = "zz";
$start = "1";
$end = "100";
$separator = ":"; // The script will output in format emailid{separator}password. So if you want emailid:pass then enter ":" separator.
for($i=$start;$i<=$end;$i++) {
$euser = $prefix . $i;
$f = fopen ("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddpop.html?email=$euser&domain=$edomain&password=$epass"a=$equota", "r");
if (!$f) {
$msg = 'Cannot create email account. Possible reasons: "fopen" function allowed on your server, PHP is running in SAFE mode';
break;
}
echo $euser . "@" . $edomain . $separator . $epass . "<br />";
}
?>