Look up email accounts using php code or API?
Hello guys,
Please help me to look up emails account using php code or API on WHM server. Do you have any php code or any reference you can share with me. BTW i'm not good at php coding but i can learn if you can give me a guide.
Thank you.
-
Hi @JohnDavid What are you trying to do exactly? That might help in getting you a better API function. There is the WHMAPI 1 function list_pops_for which will list email accounts on a specific account WHM API 1 Functions - list_pops_for - Developer Documentation - cPanel Documentation Thanks! 0 -
Hi @cPanelLauren Thank you for the response! What i just want is to look up all email accounts for a domain using DOMAIN. Yes i have just checked the WHMAPI 1 function list_pops_for but parameter you need for this is "user" i am right? Example: In the text box if i input the domain(example.com) then all the email accounts on domain(@example.com) will be listed. Sorry I'm just learning php and not much knowledgeable for complex PHP. Thank you, please guide me how to achieve this. 0 -
You may find this helpful: cPanel App Catalog :: ConfigServer Mail Manage 0 -
Hi @JohnDavid You might also find the UAPI here UAPI Functions - Email::list_pops - Developer Documentation - cPanel Documentation helpful. Though it'd have to be run per user it does give accounts per domain. I ran it as follows: uapi --user=$user Email list_pops regex=$domain.tld0 -
Thank you @Infopro but i like to create a php code for this because i have bunch process needs to test. Thank you @cPanelLauren but any API that we can use $domain as variable or parameter to use to list all email accounts for the domain? Or any way to to query $domain and list all email accounts? 0 -
There's no API function that can do just that for ALL accounts on the server but I did find the following thread which might be helpful: Thanks! 0
Please sign in to leave a comment.
Comments
6 comments