The code is as such..
Code: Select all
Create Custom Mailboxes using cPanel
If you are using cPanel and you want to add an automated email signup form to your web site that's so easy.
First create an html form and get the following information from user :
- New Email Address.
- Password.
- ... (other information are not required.)
Now set the action of this form to "signup.php" with the POST method and set the value to your email address.
Example :
<FORM name=a method=POST action="signup.php" autocomplete=off>
<input type="hidden" name="to" value="your email address">
Now use the following code as "signup.php" :
----------
<?php
$ok = TRUE;
$file = fopen ("http://username:password@Server's IP:2082/frontend/Xskin/mail/doaddpop.html?email=$NewEmail&domain=$domain&password=$Password"a=50", "r");
if (!$file) {
$ok = FALSE;
$target = "error.htm";
}
while (!feof ($file)) {
$line = fgets ($file, 1024);
if (ereg ("already exists!", $line, $out)) {
$ok = FALSE;
$target = "error.htm";
}
}
fclose($file);
if ($ok) {
$target = "done.htm";
$form_fields=array_keys($HTTP_POST_VARS);
$temp="\n";
while($field=array_pop($form_fields)){
$temp.=" $field : = $HTTP_POST_VARS[$field] \n";
}
mail($HTTP_POST_VARS['to'],"Free Email",$temp);
}
header("location:$target");
?>
I am using CPanel X Build 9.3.0-RELEASE 5. Hopefully, this has already been done and my searches were just not using the correct phrases or hopefully someone is willing to help out!
Thanks in advance,
Partie™
P.S. I'm not expecting that high of a memberlist (maybe 50, darn happy to hit 100 users, TOPS.)