How To Mass Create Email Addresses In cPanel
Now start up Firefox, and start iMacros (there should be a button in your toolbar to open it).
- In the iMacro window click on the Edit tab.
- Select #Current.iim, and click on Edit Macro.
- Paste the results from the php script into the window that opens (mine opens in notepad), and save it.
- Now you just have to login to cpanel, and then Play the macro.
(Optionally you can record a bogus macro, save that and then edit it if you want to save this macro for future use)
And that’s it. I know this tutorial will be out of date as soon as cPanel updates to a new default theme, and the exact iMacros code will be a bit different if you are using a different theme, but I hope this can act as a guide for you on how to do this. I guarantee that figuring out how to do this will be way faster than entering 100+ emails individually.

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!