Page 1 of 1

Create Inquiry Form

Posted: Tue Nov 25, 2014 3:14 am
by Niraj7878
I have created inquiry form & when i clicked submit ,msg gone sucessfully but admin cant receiving email nofitication

Code: Select all

<?
define('IN_SITE', 	true);
include_once("includes/common.php");

//include_once($physical_path['DB_Access']. 'Country.php');
//$country = new Country();

if($_POST['Submit'] == 'Send')
{
    
     ///mail to client
	global $mail2;
	$mail2 = '';
	$mail2 = new htmlMimeMail();
	
	$mail2->setFrom($_POST['mem_email']);
	$mail2->setSubject('Enquiry Request Received');
	$tpl2 = new Smarty;
	$tpl2->template_dir = $physical_path['EmailTemplate'];
	$tpl2->compile_dir 	= $physical_path['Site_Root']. 'templates_c/';
	$tpl2->debugging 	= DEBUG;

	$tpl2->assign(array("mem_fname"			=>	$_POST['mem_fname'],
						"mem_email"			=>	$_POST['mem_email'],
						"mem_tel_no"		=>	$_POST['mem_tel_no'],
						
						"enquiry"			=>	$_POST['enquiry'],
						//"mem_country"		=>	$country->GetCountryName($_POST['mem_country']),
					));
	$mail2->setHtml($tpl2->fetch('enquiry'. $config['tplEx']));
//	print $mail2->html;die;
	$result = $mail2->send(array($config[WC_CONTACT_US]));
	header("location: enquiry.php?success=true");
	exit();
}

if($_GET['success'] == true)
{
	$tpl->assign(array(	"T_Body"		=>	'enquiry_finish'. $config['tplEx'],
					));
}
else
{
	//$country_rec = $country->GetCountryList();
	//$arr_country = fillDbCombo($country_rec,'country_id','country_name',$_POST['mem_country']);
	$tpl->assign(array(	"T_Body"			=>	'enquiry'. $config['tplEx'],
						"JavaScript"		=>  array("enquiry.js"),
						"msg"			    =>	$error_msg,
						//"country"			=>	$arr_country,
						));
						
}
$tpl->display('default_layout'. $config['tplEx']);
?>

Re: Create Inquiry Form

Posted: Tue Nov 25, 2014 3:48 am
by requinix
Did you check the value of $result? Do you have your PHP set up to show or log all errors? Have you checked for warnings or notices or other non-fatal errors? Is your machine able to send emails in the first place? Did the email arrive but get placed into a spam folder?

Re: Create Inquiry Form

Posted: Tue Nov 25, 2014 4:01 am
by Niraj7878
In log file there are no warning or fatal error.
$result = $mail2->send(array($config[WC_CONTACT_US]));In contact_us i have Define my mail address.
I have check email ,mail is not in spam folder.& i have check machine able to send email.