Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($_POST)
- {
- if(!function_exists('pt_check_captch_cond'))
- {
- if(!pt_check_captch_cond())
- {
- $url = get_permalink($post->ID);
- if(strstr($url,'?'))
- {
- $url = $url."&emsg=captch";
- }else
- {
- $url = $url."?emsg=captch";
- }
- wp_redirect($url);
- exit;
- }
- }
- $yourname = $_POST['yourname'];
- $youremail = $_POST['youremail'];
- $frnd_subject = $_POST['frnd_subject'];
- $frnd_comments = $_POST['frnd_comments'];
- $pid = $_POST['pid'];
- $to_email = $_POST['to_email'];
- $to_name = $_POST['to_name'];
- if($_REQUEST['pid'])
- {
- $productinfosql = "select ID,post_title from $wpdb->posts where ID =".$_REQUEST['pid'];
- $productinfo = $wpdb->get_results($productinfosql);
- foreach($productinfo as $productinfoObj)
- {
- $post_title = $productinfoObj->post_title;
- }
- }
- ///////Inquiry EMAIL START//////
- global $General;
- global $upload_folder_path;
- $store_name = get_option('blogname');
- $clientdestinationfile = TEMPLATEPATH."/library/notification/send_to_friend.txt";
- $message1 = implode('',file($clientdestinationfile));
- $filecontent_arr1 = explode('[SUBJECT-STR]',$message1);
- $filecontent_arr2 = explode('[SUBJECT-END]',$filecontent_arr1[1]);
- $subject = $filecontent_arr2[0];
- if($subject == '')
- {
- $subject = $frnd_subject;
- }
- $client_message = $filecontent_arr2[1];
- $curpermalink = get_permalink();
- $post_url_link = '<a href="'.$curpermalink.'">'.$post_title.'</a>';
- /////////////customer email//////////////
- $yourname_link = $yourname.'<br>Send from - <b><a href="'.get_option('siteurl').'">'.get_option('blogname').'</a></b>.';
- $search_array = array('[#$to_name#]','[#$post_title#]','[#$frnd_subject#]','[#$frnd_comments#]','[#$your_name#]','[#$post_url_link#]');
- $replace_array = array($to_name,$post_url_link,$frnd_subject,nl2br($frnd_comments),$yourname_link,$post_url_link);
- $client_message = str_replace($search_array,$replace_array,$client_message);
- /*echo "From : $youremail Name : $yourname <br>";
- echo "To : $to_email Name : $to_name <br>";
- echo "Subject $subject <br>";
- echo "$client_message";
- exit;*/
- sendEmail($youremail,$yourname,$to_email,$to_name,$subject,$client_message,$extra='');///To clidne email
- //////Inquiry EMAIL END////////
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- mail($to_email, $subject, $client_message, $headers);
- $url = get_permalink($post->ID);
- if(strstr($url,'?'))
- {
- $url = $url."&sendtofrnd=success";
- }else
- {
- $url = $url."?sendtofrnd=success";
- }
- wp_redirect($url);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment