email and itergration help

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   email and itergration help
taker73044
CZ Newbie
taker73044 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Dec 06, 2005
0.00 posts per day
Posts: 1
Points: 52
   
i found a free whm program that automaticaly sets up website accounts. but im haveing one problem with it the email is not working. it wont email the coustomers like it is soppose to the designer say its because the php mail() is not activated on my site well my host has no clue what php mail() is. so can someone help me in recodeing this so it will work or tell me what to do heres the code for that . also i want ti intergrade it with nuke can someone help with that .

this is the create.php file that sets up the account and emails



<?php
session_start();
include('global.php');
if(!$_SESSION['rand'] && $image == "yes")
{
header('Location: new.php');
exit;
}
function amfrerror($error, $template)
{
if(!$template)
{
$template = 'default';
}
$template_content = file_get_contents('templates/'.$template.'/signup_error.tpl');
$template_content = str_replace('<*ERROR*>', $error, $template_content);
$template_content = str_replace('<*COPYRIGHT*>', '<a href="http://www.amfrservices.com">AMFR Account Creator version 1.0 Final</a>', $template_content);
die($template_content);
}
$domain2 = $_POST['domain2'];
$domain = $_POST['domain'];
$user = $_POST['user'];
$pass = rand();
$email = $_POST['email'];
$key = $_POST['c2'];
if(!$user || !$domain || !$domain2 || !$email)
{
amfrerror('Not all field were filled in!', $template);
}
$image2 = $_POST['image2'];
if($image == "yes")
{
if($image2 != $_SESSION['rand'])
{
amfrerror('Number does not match one in picture!', $template);
}
}
if(strlen($user) > icon_cool.gif
{
amfrerror('Username cannot be longer that 8 characters!', $template);
}
if(eregi('www\.', $domain2))
{
amfrerror('Invalid domain!', $template);
}
$link = mysql_connect($host, $dbuser, $dbpass);
if($skeys == "yes") {
$result = mysql_db_query($dbname, "SELECT * FROM amfr_keys WHERE amfrkey='$key'");
if (mysql_num_rows($result) == 0) {
amfrerror('Invalid signup key!', $template);
}
}
$domain3 = $domain2.".".$domain;
$result = mysql_db_query($dbname, "SELECT * FROM amfr_users WHERE user='$user'");
if (!mysql_num_rows($result) == 0) {
amfrerror('Username already taken!', $template);
}
$result = mysql_db_query($dbname, "SELECT * FROM amfr_users WHERE domain='$domain2"."."."$domain'");
if (!mysql_num_rows($result) == 0) {
amfrerror('Subdomain/domain already in use!', $template);
}
$result = mysql_db_query($dbname, "SELECT * FROM amfr_users WHERE email='$email'");
if (!mysql_num_rows($result) == 0) {
amfrerror('Email already used!');
}
$file = file_get_contents("http://".$cpuser.":".$cppass."@localhost:2086/scripts/wwwacct?sign=&plan=".$cppackage."&domain=".$domain3."&username=".$user."&password=".$pass."&contactemail=".urlencode($email));
if(ereg('<img src=\/icons\/error\.gif>', $file)) {
if(ereg(' username ', $file)) {
amfrerror('Username already taken!', $template);
}
else {
amfrerror('There was an error with your signup!', $template);
}
}
mail($email, "Free hosting account set up", "A free cPanel hosting account has been set up for you.\nAccount details:\nUsername: $user\nPassword: $pass\nDomain: ".$domain2.".".$domain."\nTo login to cpanel go to [ Register or login to view links on this board. ] ".$domain2.".".$domain."/cpanel\nIf you are using your own domain please set your name servers to '$ns1' and '$ns2'".".", "From: Automailer");
$logyear = date('Y');
$logmonth = date('n');
$logday = date('j');
$result = mysql_db_query($dbname, "INSERT INTO amfr_logs values('$user', $logmonth, $logday, $logyear)");
$result = mysql_db_query($dbname, "INSERT INTO amfr_users values('$user', '$domain2"."."."$domain', '$email')");
if($skeys =="yes") {
$result = mysql_db_query($dbname, "INSERT INTO amfr_used_keys values('$key', '$user')");
if($mkeys != "yes")
{
$sql = "DELETE FROM amfr_keys WHERE amfrkey='$key'";
$result = mysql_db_query($dbname, $sql);
}
}
if(!$template)
{
$template = 'default';
}
$template_content = file_get_contents('templates/'.$template.'/signup_finished.tpl');
$template_content = str_replace('<*USERNAME*>', $user, $template_content);
$template_content = str_replace('<*PASSWORD*>', $pass, $template_content);
$template_content = str_replace('<*EMAIL*>', $email, $template_content);
$template_content = str_replace('<*COPYRIGHT*>', '<a href="http://www.amfrservices.com">AMFR Account Creator version 1.0 Final</a>', $template_content);
echo $template_content;
mysql_close($link);
?>




Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
I would have your host look into why the php mail() function isn't working. You will have many customers unhappy if they couldn't use that function.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum