How To Mass Create Email Addresses In cPanel
6
2008
Creating a lot of email address in cPanel can be a real pain the neck considering that there is no way to create multiple email addresses at once. However, this task can be accomplished with iMacros, a macro plugin for Firefox, and a bit of php.
If you don’t have iMacros installed, get it here. Once you get that installed, here are the steps.
Create your iMacros Script
Here is where you need some php skills. You’ll need a list of your email addresses (username only), and passwords. These should be in a comma separated list like this:
jamese,sup3rs3cr3t
maxp,sh0p3rs7ar
jeremys,madsk1llz
Read on to get the php script…

Comment by Tim
on 06 Mar 2008 at 2:59 am #
Nice post!
I think you can do all this without even using PHP. iMacros can read from CSV files directly. So in your macro just use
CMDLINE !DATASOURCE Address.csv
‘Number of columns in the CSV file. This must be accurate!
SET !DATASOURCE_COLUMNS 1
‘Start at line 2 to skip the header in the file
SET !LOOP 2
And then use {{!COL1}} for your emails:
TAG POS=1 TYPE=… CONTENT={{!COL1}}
I got this idea from http://wiki.imacros.net/Demo-Loop-Csv-2-Web
Comment by David Grega
on 06 Mar 2008 at 11:52 am #
You can avoid the possibility of the code being obsoleted by a new GUI by accessing the APIs directly. You can use our XML-API to call the appropriate API1/API2 functions that handle the actual creation of mail accounts. If you have root access, all you have to do is analyze the code of the X3 theme to see what APIs it calls and use those calls yourself.
The X3 theme is located at /usr/local/cpanel/base/frontend/x3
The paths for individual screens is fairly simple as it is merely a series of special web pages. For example, frontend/x3/mail/pops.html would be located at /usr/local/cpanel/base/frontend/x3/mail/pops.html – though all that particular page does is pass parameters to another page to be processed. The code is fairly simple and easy to sort though.
We are currently working on comprehensive API documentation so you wont need to look at the X3 source code to determine which API calls you need to use. However, you can find our current documentation on our website at:
http://www.cPanel.net/plugins/devel
Comment by James Ehly
on 06 Mar 2008 at 3:36 pm #
Awesome comments Guys! Thanks for your response and for the ideas!
Comment by Vinod
on 12 Sep 2008 at 5:15 am #
Thanks.. something we were looking for..It would certainly take some time as it is a macro.. but there will be atleast no pain ..\
Comment by M Tee
on 28 Sep 2008 at 5:24 pm #
Hey,
I just tried your script but whenever I run it says:
Parse error: syntax error, unexpected ‘,’ in /home/gktsmec/public_html/rep.php on line 2
The first line with $text
Any help would be appreciated. Thanks.
Comment by James Ehly
on 28 Sep 2008 at 8:15 pm #
Hi M,
Make sure the quote in line 2 is a normal quote. Wordpress likes to turn my quotes into fancy ones for some reason and PHP won’t like that. That’s all I can think it might be.
James
Comment by john
on 10 Sep 2009 at 11:34 am #
I get the:
SyntaxError: can not parse macro line: <?php
What gives? I use the exact same coding.
Comment by James Ehly
on 11 Sep 2009 at 3:44 pm #
Sounds like you might be trying to enter php into the iMacros editor. You’ll need to run the php from the command line or through a php enabled web server. If you don’t know anything about PHP, then this method probably isn’t for you.