isSMTP(); //$mail->SMTPDebug = 2; //Ask for HTML-friendly debug output $mail->Debugoutput = 'html'; $mail->Host = "smtp.yandex.com"; $mail->Port = 465; $mail->SMTPAuth = true; $mail->SMTPSecure = 'ssl'; $mail->Username = "info@kidscaresolutions.com"; $mail->Password = "Q1w2e3r4t5"; $mail->setFrom("info@kidscaresolutions.com", 'Kids Care'); $mail->addReplyTo("info@kidscaresolutions.com", 'Kids Care'); $mail->CharSet = 'UTF-8'; $mail->addAddress($receiver); $mail->Subject =$subject; $mail->Body =$message; //$mail->AddCustomHeader('Reply-to:admin@healthrecordspro.com' ); $mail->IsHTML(true); //$rand = rand(100, 10001000 ); //$mailFileName = $mailFileName.'.pdf'; if( !$mail->send() ){ echo $msg .= "Mailer Error: " . $mail->ErrorInfo; }else{ //echo $msg = "Message sent!"; echo $msg = ""; } //die("Mahesh"); } function getUserIP() { $client = @$_SERVER['HTTP_CLIENT_IP']; $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; $remote = $_SERVER['REMOTE_ADDR']; if(filter_var($client, FILTER_VALIDATE_IP)) { $ip = $client; } elseif(filter_var($forward, FILTER_VALIDATE_IP)) { $ip = $forward; } else { $ip = $remote; } return $ip; } function get_ip_country(){ global $db; $s = file_get_contents('http://ip2c.org/'.getUserIP()); //print_r($s); $reply = explode(';',$s); $country_iso_code = $reply[1]; if($country_iso_code=='BH'){ $stock = 'BH' ; }else if($country_iso_code=='SA'){ $stock = 'SA' ; }else if($country_iso_code=='EG'){ $stock = 'EG' ; }else if($country_iso_code=='IQ'){ $stock = 'IQ' ; }else{ $stock = 'others' ; } return $stock; } function resize_image($imagepath, $destinationpath='') { if(!$destinationpath){ $destinationpath = $imagepath; } require_once 'resize-classnew.php'; $resizeObj = new resize(); $imgpath_thumb=$resizeObj->ImagePath($imagepath); if($imgpath_thumb) { list($original_width, $original_height) = getimagesize($imagepath); $big_Imagewidth=500; $big_Imageheight=ceil(($big_Imagewidth*$original_height)/$original_width); $resizeObj -> resizeImage($big_Imagewidth,$big_Imageheight, 'landscape'); $resize=$resizeObj -> saveImage($destinationpath); } return $imgpath_thumb; } ?>