'sendmail', //use sendmail , smtp or mail 'smtphost' => '', //smtp host address 'smtpauth' => 'no', //smtp authentication yes or no 'smtpusr' => '', //SMTP username 'smtppwd' => '', //SMTP password 'to_email' => 'info@pro2s.com,thuy.tran@pro2s.com', //to email address 'subject' => 'Enquiry : Request sample', //email subject 'ishtml' => 'true', //is this mail html format ); //-------------------------------------------------------------------- /** * send mail function */ function _np_sendmail($from, $data){ //get phpmailer class require(dirname(__FILE__)."/lib/smtp/class.phpmailer.php"); $mail = new PHPMailer(); //check is using smtp or sendmail] if ($data["mailer"] == "smtp"){ $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = $data["smtphost"]; // specify SMTP host //check auth needed if($data["smtpauth"] == "Y"){ $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = $data["smtpusr"]; // SMTP username $mail->Password = $data["smtppwd"]; // SMTP password } } else if ($data["mailer"] == "smail"){ $mail->IsSendmail(); // set mailer to use sendmail } else { $mail->IsMail(); // set mailer to use mail } //set from email and name $mail->From = $from["coemail"]; $mail->FromName = $from["comain"]; //set reply to $mail->AddReplyTo($from["coemail"], $from["comain"]); //set to address $to = $data['to_email']; $mail->AddAddress($to); $mail->WordWrap = 60; // set word wrap to 50 characters //content type is html $html = false; if($data['ishtml']){ $mail->IsHTML(true); }else{ $mail->IsHTML(false); } // set email format to HTML //set subject $mail->Subject = $data['subject']; //get lib filter class require(dirname(__FILE__)."/lib/lib_filter.cls.php"); //loop the glove size $_glove = ''; foreach($from['cogrove'] as $k => $v){ $_glove .= $v."\n"; } $body = <<< html
Company Name : {$from['coname']} 

Phone : {$from['cophone']} 

Street Address : {$from['coadd']} 

City/State/Zip : {$from['cocsz']} 

Email : {$from['coemail']} 

Website : {$from['coweb']} 

Main Contact : {$from['comain']} 

Title : {$from['cotitle']}

Total Number of employees : {$from['coemp']} 

Glove Sizes :
{$_glove}
html; //set body content and alt content //filter clear html tag $altbody = _np_getclearcontents($body); $mail->Body = $body; $mail->AltBody = $altbody; error_reporting(E_ALL ^ E_WARNING); if(!$mail->Send()) { error_reporting(E_ALL); return false; } error_reporting(E_ALL); return true; } //-------------------------------------------------------------------- /** * get request parameter * @return param value if found else return default value */ function _get_param($arr, $key, $default=""){ return isset($arr[$key])? $arr[$key] : $default; } //-------------------------------------------------------------------- /** * form validation */ function validate($val){ $valid = true; $msg = 'Please complete the following fields:
'; //check company name if(empty($val['coname'])){ $valid = false; $msg .= '- Enter Company Name please
'; } //check company phone if(empty($val['cophone'])){ $valid = false; $msg .= '- Enter Phone please
'; } //check address if(empty($val['coadd'])){ $valid = false; $msg .= '- Enter Street Address please
'; } //check City/State/Zip if(empty($val['cocsz'])){ $valid = false; $msg .= '- Enter City/State/Zip please
'; } //check email if(!ereg("^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$",$val['coemail'])){ $valid = false; $msg .= '- Enter valid email please
'; } //check Main Contact if(empty($val['comain'])){ $valid = false; $msg .= '- Enter Main Contact please
'; } //check Title if(empty($val['cotitle'])){ $valid = false; $msg .= '- Select Title please
'; } //check Total Number of employees if(empty($val['coemp'])){ $valid = false; $msg .= '- Enter Total Number of employees please
'; } //check grove size $cnt = count($val['cogrove']); if($cnt < 1 OR empty($val['cogrove'])){ $valid = false; $msg .= '- Please check at least one Glove Sizes
'; } return array('valid' => $valid, 'msg' => $msg); } //-------------------------------------------------------------------- $form_action = $_SERVER['PHP_SELF']; //name $_f['coname'] = trim(_get_param($_POST, 'coname', '')); //phone $_f['cophone'] = trim(_get_param($_POST, 'cophone', '')); //address $_f['coadd'] = trim(_get_param($_POST, 'coadd', '')); //City/State/Zip $_f['cocsz'] = trim(_get_param($_POST, 'cocsz', '')); //email $_f['coemail'] = trim(_get_param($_POST, 'coemail', '')); //website $_f['coweb'] = trim(_get_param($_POST, 'coweb', '')); //main contact $_f['comain'] = trim(_get_param($_POST, 'comain', '')); //title $_f['cotitle'] = trim(_get_param($_POST, 'cotitle', '')); //total employee $_f['coemp'] = trim(_get_param($_POST, 'coemp', '')); //grove size $_f['cogrove'] = _get_param($_POST, 'cogrove', ''); $msg = ''; if(isset($_POST['cosubmit'])){ $chk = validate($_f); //check valid if($chk['valid']){ $msg = 'Thank you for your feedback, it has been submitted.'; //send mail if(!_np_sendmail($_f, $data)){ $msg = 'Sorry, an error has occur! Please contact webmaster now.'; } else { //name $_f['coname'] = ''; //phone $_f['cophone'] = ''; //address $_f['coadd'] = ''; //City/State/Zip $_f['cocsz'] = ''; //email $_f['coemail'] = ''; //website $_f['coweb'] = ''; //main contact $_f['comain'] = ''; //title $_f['cotitle'] = ''; //total employee $_f['coemp'] = ''; //grove size $_f['cogrove'] = ''; } } else { $msg = ''.$chk['msg'].''; } } $form = <<< htm {$msg}

( * = required)

Company Name *
Phone *
Street Address *
City/State/Zip *
Email *
Website  
Main Contact *
Title *
Total Number of employees *

Glove Sizes

Extra Small Small Medium
Large X-Large  

 

   

 

* Please click on the back button to return to this page if you miss a field(s) to avoid retyping the entries. Thank you.

htm; ?> Welcome to Pro2s Solutions: Your Professional Protective Solutions Partner

Protective Products by Profession

HealthCare & Dental
Industrial & Non-Medical

Protective Products by Solution

Latex-Free (Synthetic)
Powder-Free
Barrier Protection

Pro2 NEWEST Products

Ecobee™ BeeSure
ClearlyNitrile Series
SkinTek Series
Xlim Series
Cyntek Series
S3 Face Mask
S3 ACE Face Mask
S3 C2 Face Mask
Deep Treatment Cream
home about solutions career contact register
 
Home    |    About    |    Solutions    |    Career    |    Contact    |    Register
Copyright © Pro2 Solutions, Inc., 2007. All Rights Reserved.Powered by GreenEarth