Results 1 to 9 of 9
  1. #1

    PHP + cPanel Email

    I have a script that allows me to add cPanel email accounts through PHP. I am curious though, is there any way to edit the passwords on the accounts or can you only delete them (with PHP)?

  2. #2
    use sendmail

  3. #3


    Two words...? I would appreciate a little more assistance than that... What does sendmail have to do with editing email account passwords?

  4. #4
    Join Date
    Nov 2003
    Any of the cPanel account management functions can be done through PHP by sending GET or POST requests (using fwrite() is probably how you'll want to do it.)

  5. #5
    As brendandonhu said, you can execute any cPanel function remotely using (in best practice) cURL module or socket module in PHP, cURL is most advanced, because it simulates normal web browser functions in comunication with remote site, web page. It supports SSL nicely, so you can user POST or GET methods to do one or more actions in remote way.

    There is a lot of working examples.

    So having already written script you can construct your own remote commands, like, changing e-mail account password etc...

    No sendmail internal functions needed


  6. #6
    Join Date
    Nov 2003
    cPanel doesn't care if you simulate a real browser or not so socket functions work fine for this.

  7. #7
    Sure, but you'll have much less problems using SSL, in example you need access WHM with remote access key where WHM is only accessable trought SSL .


  8. #8
    Join Date
    Nov 2003
    Works fine with the socket functions, you just add ssl:// to the beginning of the hostname and connect to the SSL port.

  9. #9
    Does it work with untrusted SSLs too? :/

    The conclusion is: use cURL or sockets, your PHP configuration will "help" you to decide .

    I prefer cURL.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts