Create an email account with PhP - With some things I need to work around

≡放荡痞女 提交于 2020-01-06 02:12:50

问题


I need to create an email account in PhP. I found a ton of code samples online that do this, however I have a few problems:

  • I'm on a shared server host with the default php.ini, and my host won't change it
  • I need to create it via a URL, not with forms (something like: mywebsite.com/email.php?username=user)
  • The password and quota created needs to be the same every time, so the only thing after the ? I need is the username

I have 0 experience with PhP so I can't just edit one I find online, so sorry if this is easy. If someone could point me in the direction of a script someone made or something that'd be great! Thanks.


回答1:


From your reply, it turns out that you are using cPanel. This is quite helpful, as cPanel provides its own XML API for some administrative tasks, including creating email accounts.

You can find a ready made script that uses the cPanel XML API and does what you require in this forum post:

http://forums.glowhost.com/programming-talk/using-cpanel-api-creating-email-account-forwarders-your-own-php-scripts-2798.html

This SO question contains information on how to use the cPanel XML API yourself.

If for some reason you can't get the XML API to work, there's another script that makes regular HTTP calls to cPanel itself over here:

http://www.zubrag.com/scripts/cpanel-create-email-account.php



来源:https://stackoverflow.com/questions/16996779/create-an-email-account-with-php-with-some-things-i-need-to-work-around

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!