Jump to content

IMAP + PHP + Create New User Account


HDFilmMaker2112

Recommended Posts

here i found this awhile back and i used it and it worked

<?php
// Domain Logon Details
$username="";
$password="";

// Domain details
$domain="www.xxxxx.com";
$theme="xxxxx";//eg "fantastico_bluelagoon";

// Parameters to parse
$eEmail="";
$eDomain="xxxxx.com";
$ePassword="";
$eQuota=""; // eg"10";

// Put post fields variable together
$postfields = "email=$eEmail&domain=$eDomain&password=$ePassword&quota=$eQuota";

// initialise Curl
$popPost = curl_init();

// Set Curl Option: URL
$url="http://$domain:2082/frontend/$theme/mail/doaddpop.html";
curl_setopt($popPost, CURLOPT_URL, $url);

// Set Curl Option: Username:Password
curl_setopt($popPost, CURLOPT_USERPWD, "$username:$password");

// Set Curl Option: Post style request = true
curl_setopt($popPost, CURLOPT_POST, 1);

// Set Curl Option: Collect result from script
curl_setopt($popPost, CURLOPT_RETURNTRANSFER, 1);

// Set Curl Option: Set timeout to 15 seconds
curl_setopt($popPost, CURLOPT_TIMEOUT, 15);

// Set Curl Option: Post data
curl_setopt($popPost, CURLOPT_POSTFIELDS, $postfields);

// Execute Request, and store result in $tb_post
$popPost_result = curl_exec ($popPost);

// Close Curl
curl_close ($popPost);

      //output results
      $start = strpos($popPost_result, '<b>Account');
      $end = strpos($popPost_result, 'created.');
      $subset = substr($popPost_result, $start, $end+8-$start);
      $subset = str_replace('login ', "login<br>", $subset); //for neatness
      //$subset=str_replace("<!",'<-',$subset); //see the comments
      if (preg_match ('/Sorry/i', "$subset")) {
          print "<br><b>   Sorry that account already exists.</b><br><br>";
          //print ($subset);
      } elseif(preg_match ('/You must specify/i', "$subset")) {
          print "<br><b>You must specify a password.</b><br><br>";
      } else {
          print ($subset);
          print "<br><br>You may now use <b>mail.$domain</b> as your POP3 setting in your mail client or access <b>WebMail</b> by selecting <a href=http://$domain/webmail>Here</a>.
              <center>
              <br><a href=javascript:history.go(-1)>Go Back</a>
              </center>";
      }
?>
[/code[

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.