Create new email account using php
Hello all,
i am very new in the cpanel world, i have a website that uses cpanel, and i have a laravel website created. in this project, i have set up users login/creation, so now, what i want to do is, instead of going in the cpanel dashboard and create manually email address, is it possible to create new email from php?
here is my workflow i want to achieve:
user signs up on laravel frontend
the data is received in the backend, with data validation etc; lets call the user testuser
when all is fine with his data, then, i want to create an email, from laravel (my domain is lets say example.com) like: testuser@example.com with some password without doing it manually in the cpanel (those emails are for sending and receiving texts only, so no big quota needs to be set for them).
i've seen several scripts (ranging from the old xmlapi that is not supported anymore) to some others that use sockets, but it seems i cant get them to work.
can anyone share his knowledge on this?
-
Glad you were able to get this resolved! Thanks for letting us know. 0 -
ah, ran into this article. tried the xmlapi.php, it was not working. on second try, saw that i need to get response as json to get it to work nice. the email is created as i need to now. thank you again :)
Please share the solution or the steps you used0 -
Please share the solution or the steps you used
[CODE=php] $xmlapi = new xmlapi($ip); $xmlapi->set_port($port); $xmlapi->password_auth($account, $passwd); $xmlapi->set_output('json');
where $ip, $port, $account and $password are simple string variables containing your settings. $xmlapi->set_output('json'); is what i added0
Please sign in to leave a comment.
Comments
5 comments