Advertisement
pixedelic

mailer.delight.5.0.5.php

Oct 16th, 2013
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.14 KB | None | 0 0
  1. <?php require_once( '../../../../../wp-load.php' ); ?>
  2. <?php
  3. $captcha = $_GET['captcha'];
  4. if($captcha!='' || $captcha!='undefined'){
  5.     $cryptinstall=TEMPLATEPATH."/scripts/crypt/cryptographp.fct.php";
  6.     include $cryptinstall;
  7. }
  8. ?>
  9. <?php
  10.     $list_keys=array_keys($_GET);
  11.     $list_values=array_values($_GET);
  12.     $num=count(array_keys($_GET));
  13.      
  14.  
  15. $form = $_GET['form'];
  16. $i = 0;
  17. $pix_array_your_forms = get_pix_option('pix_array_your_forms_');
  18. while($i<count($pix_array_your_forms)){
  19.     $pix_array_your_field = get_pix_option('pix_array_'.sanitize_title($pix_array_your_forms[$i]).'_fields_');
  20.    
  21.     if (!$errors && $form==sanitize_title($pix_array_your_forms[$i])) {
  22.         if($captcha=='' || $captcha=='undefined' || chk_crypt($captcha)){
  23.            
  24.             $to = get_pix_option('pix_array_'.sanitize_title($pix_array_your_forms[$i]).'_recipient');  
  25.        
  26.             $headers = "MIME-Version: 1.0\n" .
  27.                 "From: ". $_GET['email'] . " <". $_GET['email'] . ">\n" .
  28.                 "Content-Type: text/html; charset=\"" .
  29.                 get_pix_option('blog_charset') . "\"\n";
  30.              
  31.        
  32.             $subject = get_pix_option('pix_array_'.sanitize_title($pix_array_your_forms[$i]).'_subject');;
  33.             $message = '
  34.             <html>
  35.             <body>
  36.             <table>';
  37.                 for($i=0;$i<$num;$i++) {
  38.                     if (($list_keys[$i]!="form" && $list_keys[$i]!="captcha" && $i!=0 && $list_keys[$i]!='_') ) {
  39.                         $message.= '<tr><td>'.$list_keys[$i].":<td>".stripslashes(nl2br($list_values[$i]))."</td></tr>";
  40.                     }
  41.                 }
  42.        
  43.             $message .='</table>
  44.             </body>
  45.             </html>';
  46.            
  47.          
  48.        
  49.             add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
  50.             $result = wp_mail( $to, $subject, $message, $headers, $attachments );
  51.              
  52.        
  53.             echo $result;
  54.         } else {
  55.             echo 'noCaptcha';
  56.         }
  57.      
  58.    
  59.     }//endif
  60. $i++;
  61. }//endwhile
  62.      
  63.      
  64.     function sendmail($to, $subject, $message, $from) {
  65.         $headers = "MIME-Version: 1.0" . "\r\n";
  66.         $headers .= "Content-type:text/html;charset=utf-8\r\n";
  67.         $headers .= 'From: ' . $from . "\r\n";
  68.          
  69.         add_filter('wp_mail_content_type',create_function('', 'return "text/html";'));
  70.         $result = wp_mail($to,$subject,$message,$headers);
  71.          
  72.         if ($result) return 1;
  73.         else return 0;
  74.     }
  75.  
  76.  
  77. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement