Skip to main content

How to Dynamically generate email forwarders

Comments

3 comments

  • martin MHC
    That's exactly what I'm looking for, many thanks William. I had searched but hadn't found this. A few notes: Some Queries:
    • 1) How do I call the LiveAPI from within my PHP script? Should this be only called by a cron job rather than a live script? The LiveAPI loads and then because the __construct is requiring an ENV variable, this will not run as it's not a command line PHP instance.
    • 2) The CPANEL class uses `exec` and other "high risk" functions that are disabled by default in PHP. I can find no way of enabling these functions just for this script/class/instance . Is the CPANEL class subject to these PHP limits and how can they be circumvented? Do these limits also apply to Cron Jobs ( some searching seems to be surprisingly ambiguous on this point)
    • 3) This class overall seems to be geared to being run from the server rather than from any particular hosted account (example: "/home/account/public_html/email_fwder_maker.php")? Any clarifications on the above gratefully received. I have looked around the SDK pages but can't see explanations of the above. Cheers
    0
  • cPanelMichael
    I do not (think) I want a CPanel plugin . I am working in PHP on the website buildand want to be able to get PHP to instruct the account to set up or delete an email forwarder.

    Hi @martin MHC, Since this isn't for a cPanel plugin, you should actually avoid using the LiveAPI system. It's intended for use with applications added to the cPanel interface. Instead, you'd want to use a PHP client class like the user-submitted one referenced on the following thread: Thank you.
    0

Please sign in to leave a comment.