Bulk set default email address

yondermann

Registered
May 20, 2021
4
1
3
Spain
cPanel Access Level
Website Owner
Hi,
I've got several subdomains created for a main domain like this:
sb1.company.com
sb2.company.com
sb3.company.com
I also have emails created for each subdomain:
[email protected]
[email protected]
[email protected]
I'd like to set each email as a default address for each subdomain without manually going through the process in cPanel one by one. Is there a script or easy way to achieve that?
Thanks!
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,494
1,009
313
cPanel Access Level
Root Administrator
Hey there! Can you get me more details on the setup you're working with? Is each one of those subdomains a unique cPanel account? If so, you could use the following API to set the address for each account:

 

yondermann

Registered
May 20, 2021
4
1
3
Spain
cPanel Access Level
Website Owner
Hey there! Can you get me more details on the setup you're working with? Is each one of those subdomains a unique cPanel account? If so, you could use the following API to set the address for each account:

I'm not exactly sure what you are asking but no. There is only one cPanel account on shared hosting with one domain. The subdomains are created under the main domain in the same cPanel account.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,494
1,009
313
cPanel Access Level
Root Administrator
After re-reading that API documenation, it would still work well but you would just need to add the option "domain" flag so it knows the specific subdomain you are working with. This could then be scripted to loop through a text file and setup the preference(s) of your choice.