Just a quick contact to see if someone could lend a hand on a clients website of mine?

It's a help desk software called ExoPHPDesk that I have installed.

It is supposed to email admins upon new user registrations, new tickets, etc but it doesn't do it anymore and Idon't know what i'm looking at to get the emails coming through again.

Is there any chance you could give me 5 mins of your time to help me out? I can pay you if needs be i don't mind.

I am desperate for someones help.

below is the register.php file. Not sure if this is all thats needed.

<?php

session_start();

// << -------------------------------------------------------------------- >>
// >> EXO Helpdesk Registration File
// >>
// >> REGISTER . PHP File - User Registration Of HelpDesk
// >> Started : November 14, 2003
// >> Edited  : February 05, 2006
// << -------------------------------------------------------------------- >>

ob_start();

define("EX_FILE", 1);

include_once ( 'common.php' );

$_Q = $db->query ("SELECT * FROM phpdesk_configs WHERE registrations='Open'" );

if ( $NO_AUTH != 1 )
{
	// IF USER COOKIES EXISTS
	header( "Location: index.php" );
}
elseif(!$db->num($_Q))
{
	echo $error['register_close'];
}
else
{

if( SUBM == NULL )
{
	_parse( $tpl_dir . 'profile2.tpl' );
	$read = getBlock( $class->read, 'MEMBER' );
	$n_pm = '<option value="1">Yes</option><option value="0">No</option>';
	$read = str_replace('^n_pm^',$n_pm, str_replace('^n_response^', $n_pm, $read));

	// PARSE ADD TICKET . TPL FILE
	_parse ( $tpl_dir . 'tickets.tpl' );

	// PREPARE VARIABLES
	$READ  =  getBlock( $class->read, 'ADD_TICKET' );
	$READ  =  rpl( '^e_text^', NULL, $READ );

	// THE OUTPUT VARIABLES
	$LIST  =  template ( $READ, $T_ST, $T_ED );
	$READ  =  template ( $READ, NULL, $T_ST );

	// GET FIELDS USING FUNCTION
	$FIELDS = get_fields( $LIST,'profile' );

	echo rpl( '^FIELDS^', $FIELDS, $read );
}
else
{

	$_Q = $db->query("SELECT * FROM phpdesk_members WHERE username='{$_POST['username']}'");
	$_Q1 = $db->query("SELECT * FROM phpdesk_staff WHERE username='{$_POST['username']}'");
	$_Q2 = $db->query("SELECT * FROM phpdesk_admin WHERE name='{$_POST['username']}'");

	// securimage
/*--- include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';

$securimage = new Securimage();

if ($securimage->check($_POST['captcha_code']) == false) {
  // the code was incorrect
  // handle the error accordingly with your other error checking

  // or you can do something really basic like this
  die('The code you entered was incorrect. <a href="http://www.i-dba.co.uk/contact.php">Click here</a> to go back and try again.');
}

// securimage2
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage2/securimage.php';

$securimage = new Securimage();

if ($securimage->check($_POST['captcha_code1']) == false) {
  // the code was incorrect
  // handle the error accordingly with your other error checking

  // or you can do something really basic like this
  die('The code you entered was incorrect. <a href="http://www.i-dba.co.uk/contact.php">Click here</a> to go back and try again.');
}

---*/

	//
	// VALIDATIONS!!!
	// First validate the user fields
	// Second validate the custom fields
	//
	$VALIDATE = validate('user',$_POST);
	$valFields = validate('fields', $_POST, 'Profile');


	if( $valFields == 1 )
	{
		echo $error['fields'];
	}
	elseif( $VALIDATE != "" )
	{
		echo $VALIDATE;
	}
	elseif($db->num($_Q) || $db->num($_Q1) || $db->num($_Q2))
	{
		echo $error['user_exists'];		
	}
	else
	{
		//
		// Get an ID
		// Pretty messy right now... :(
		//
		$Q  = $db->query( "SELECT * FROM phpdesk_staff" );
		$Q1 = $db->query( "SELECT * FROM phpdesk_members" );
		$Q2 = $db->query( "SELECT * FROM phpdesk_admin" );
		$total = $db->num($Q) + $db->num($Q1) + $db->num($Q2) + 2;
		while($x < $total)
		{	
			$x++;
			$Q = $db->query("SELECT * FROM phpdesk_staff WHERE id='{$x}'");
			$Q1 = $db->query("SELECT * FROM phpdesk_members WHERE id='{$x}'");
			$Q2 = $db->query("SELECT * FROM phpdesk_admin WHERE id='{$x}'");

			if(!$db->num($Q) && !$db->num($Q1) && !$db->num($Q2))
			{
				$id_got = $x;
				break;
			}
		}

		// Get Fields and Values for mySQL
		$FIELDS  =  get_fields ( '', 'profile', 'SQL' );
		$VALUES  =  val_fields ( $_POST, 'profile' );

		$sql = "INSERT INTO phpdesk_members (id,username,name,password,email,website,notify_pm,notify_response,registered,tppage,`FIELDS`,`VALUES`)
		VALUES('".$id_got."','".trim($_POST['username'])."', '".$_POST['name']."', '".md5($_POST['password'])."', '".$_POST['email']."', '".$_POST['website']."',
		'".$_POST['n_pm']."', '".$_POST['n_response']."', '".time()."', '".$_POST['tppage']."', '$FIELDS', '$VALUES')";

		if($db->query($sql))
		{
			echo $success['register'];
		}

		echo mail_it('register', $_POST['email'], $general['mail_title']);
	}
}
}

// INCLUDE FOOTER FILE
include_once ( 'footer.php' );

// Flush all the headers
ob_end_flush();

?>

Hope you can help.

Thanks,

George

    if it use to send mail and now doesn't, the obvious next question is what has changed?

      I haven't got a clue, even a fresh install doesn't send emails. I can vaguely remember having to edit a file with email addresses, but i've looked through all files and can't see what I need to do as I am a beginner with PHP.

      I need someone to have a look through the install for me and see if they can solve it?

        Just found the mail function for the script....

        This is in a conf.php

        // MAIL FUNCTION FOR ExoPHPDesk
        function mail_it( $type='', $to, $subject, $ext='', $name='', $tid='', $message='', $title = '' )
        {
        	global $tpl_dir,$class,$_POST,$email, $site_name;
        
        $headers = "From: {$site_name}<{$email}>\r\n"
        	      ."Reply-To: {$email}\r\n"
        		  ."X-Mailer: PHP";
        
        _parse($tpl_dir.'mail.tpl')	;
        $read = $class->read;
        
        if($type == 'register')
        {
        	$pos = (strpos($read, '[#'.$type)+strlen($type)+2);
        	$read = substr($read, $pos);
        	$pos = strpos($read, '/#'.$type.']');
        	$read = substr($read, 0, $pos);
        	$read = str_replace('^user^', $_POST['username'], str_replace('^name^', $_POST['name'], $read));
        	$read = str_replace('^pass^', $_POST['password'], $read);
        	mail($to,$subject,$read,$headers);
        }
        elseif($type == 'staff')
        {
        	$pos = (strpos($read, '[#'.$type)+strlen($type)+2);
        	$read = substr($read, $pos);
        	$pos = strpos($read, '/#'.$type.']');
        	$read = substr($read, 0, $pos);
        	$read = str_replace('^user^', $_POST['username'], str_replace('^name^', $_POST['name'], $read));
        	$read = str_replace('^pass^', $_POST['password'], $read);
        	mail($to,$subject,$read,$headers);
        }
        elseif($type == 'newpm')
        {
        	$pos = (strpos($read, '[#'.$type)+strlen($type)+2);
        	$read = substr($read, $pos);
        	$pos = strpos($read, '/#'.$type.']');
        	$read = substr($read, 0, $pos);
        	$read = str_replace('^name^', $name, str_replace('^php_file^', $ext, $read));
        	mail($to,$subject,$read,$headers);
        }
        elseif($type == 'newresponse')
        {
        	$pos = (strpos($read, '[#'.$type)+strlen($type)+2);
        	$read = substr($read, $pos);
        	$pos = strpos($read, '/#'.$type.']');
        	$read = substr($read, 0, $pos);
        	$read = str_replace('^name^', $name, str_replace('^php_file^', 'member.php', $read));
        	$message = stripslashes( $message );
        	$read = str_replace('^tid^', $tid, str_replace( '^message^', $message, $read ) );
        	mail($to,$subject,$read,$headers);
        }
        elseif($type == 'newticket')
        {
        	$pos = (strpos($read, '[#'.$type) + strlen($type)+2 );
        	$read = substr($read, $pos);
        	$pos = strpos($read, '/#'.$type.']');
        	$read = substr($read, 0, $pos);
        	$read = str_replace('^name^', $name, str_replace('^department^', $ext, $read));
        	$read = rpl( '^TITLE^', $title, rpl( '^MESSAGE^', $message, $read ));
        	mail($to,$subject,$read,$headers);
        }
        elseif($type == 'lostpass')
        {
        	$pos = (strpos($read, '[#'.$type)+strlen($type)+2);
        	$read = substr($read, $pos);
        	$pos = strpos($read, '/#'.$type.']');
        	$read = substr($read, 0, $pos);
        	$read = str_replace('^name^', $name, str_replace('^key^', $ext, $read));
        	mail($to,$subject,$read,$headers);
        }
        elseif($type == 'pipe_tcreate')
        {
        	$data = template($read, '[#'.$type, '/#'.$type.']');
        	$data = rpl(array('subject' => $title, 'message' => $message, 'tid' => $tid), '^', $data);
        	mail($to,$subject,$data,$headers);
        }
        elseif($type == '' && $message != '')
        {
        	mail($to,$subject,$message,$headers);		
        }
        }

          first thing i would try is to hard code a mail() call and see if that was working, can be done on any page on the server.

            dagon;10974982 wrote:

            first thing i would try is to hard code a mail() call and see if that was working, can be done on any page on the server.

            Thing is I haven't got a clue how to do that lol. I really don't know much of PHP at all.

              option 1- learn. option 2- hire some one.

                dagon;10974986 wrote:

                option 1- learn. option 2- hire some one.

                Mate, if there was any need for that then I would of said fair enough but there ain't so do one.

                Option 1 - This is a 'General Help' forum... that is exactly what I am after, HELP. If it was as easy to learn all of PHP in the time the scripts are needed as you say it like, then this 'General Help' forum would be redundant.

                Option 2 - I also mentioned in my 1st post 'I can pay you if needs be i don't mind.' Which in my mind probably means paying someone to do the work, which is also the same as hiring someone.

                Mate, all I was asking for is help, not some arrogant posts back.

                Cheers.

                  I attempted to help you, but your only responses is "I don't know how"; if you can't make an effort, why should I?

                  option 2. you cant advertise for jobs here, it's in the terms you should of read before joining.

                    Write a Reply...