Problem with Helpdesk software - ExoPHPDesk Not sending emails

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.

[code]<?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. Click here 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. Click here 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();

?>[/code]

Hope you can help.

Thanks,

George

Just found the mail function for the script…

This is in a conf.php

[code]// 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);		
}

}[/code]

Sponsor our Newsletter | Privacy Policy | Terms of Service