Reputation: 10712
I've a mailing list in my cPanel. When a user registers, I want to add him to my mailing list automatically. How can I do it?
Upvotes: 0
Views: 2644
Reputation: 1713
The cPanel instances that I've seen use Mailman.
There's a PEAR package which provides a PHP API to Mailman: http://pear.php.net/manual/en/package.webservices.services-mailman.php
Upvotes: 0
Reputation: 493
As far as I know, cPanel uses Mailman for mailing lists. This means you can probably do something like this to add an email to a mailing list:
shell_exec("echo [email protected] | /var/lib/mailman/bin/add_members -r - LISTNAME");
where LISTNAME is the name of the mailing list. Depending on your system, the path to the Mailman scripts may be somewhere other than /var/lib/mailman/bin/.
Upvotes: 2
Reputation: 563
It all depends on what mailing list you're using. I'm not too familiar with what cPanel uses for lists.
In the past, I have used cUrl to add databases and users via requests to specifically constructed urls within the appropriate parts of cPanel.
Upvotes: 0