Results 1 to 9 of 9
Thread: PHP + cPanel Email
-
10-19-2006, 01:26 PM #1WHT Addict
- Join Date
- Sep 2004
- Posts
- 167
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)?
Bobbie
Cornerstone IT
-
10-21-2006, 12:24 PM #2Disabled
- Join Date
- Dec 2005
- Posts
- 11
use sendmail
-
10-21-2006, 06:08 PM #3WHT Addict
- Join Date
- Sep 2004
- Posts
- 167
Uh...
Two words...? I would appreciate a little more assistance than that... What does sendmail have to do with editing email account passwords?
Bobbie
Cornerstone IT
-
10-22-2006, 01:01 PM #4Web Hosting Master
- Join Date
- Nov 2003
- Posts
- 691
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.)
-
10-26-2006, 08:36 AM #5Newbie
- Join Date
- Oct 2006
- Location
- Lithuania
- Posts
- 22
Hi,
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
Cheers.
-
10-26-2006, 04:39 PM #6Web Hosting Master
- Join Date
- Nov 2003
- Posts
- 691
cPanel doesn't care if you simulate a real browser or not so socket functions work fine for this.
-
10-26-2006, 04:47 PM #7Newbie
- Join Date
- Oct 2006
- Location
- Lithuania
- Posts
- 22
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 .
Cheers.
-
10-26-2006, 04:50 PM #8Web Hosting Master
- Join Date
- Nov 2003
- Posts
- 691
Works fine with the socket functions, you just add ssl:// to the beginning of the hostname and connect to the SSL port.
-
10-26-2006, 04:59 PM #9Newbie
- Join Date
- Oct 2006
- Location
- Lithuania
- Posts
- 22
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.
Bye