HEX
Server: Apache
System: Linux wyse1.wyseservers.com 4.18.0-553.124.4.el8_10.x86_64 #1 SMP Fri May 15 04:14:14 EDT 2026 x86_64
User: kochikidswysewor (1061)
PHP: 8.3.33
Disabled: NONE
Upload Files
File: /home/kochikidswysewor/public_html/wp-content/themes/children-charity-child/mails/user-email.php
<?php

$parse_uri1 = explode('wp-content', $_SERVER['SCRIPT_FILENAME']);
$parse_uri = explode('children-charity-child', $_SERVER['SCRIPT_FILENAME']);

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;  


require_once($parse_uri1[0].'wp-load.php');
  $current_user = wp_get_current_user();
    $args = array(
      'post_type'      => 'donations',
      'p'              => $id,
      'posts_per_page' => 1
    );
    $query = new WP_Query( $args );
    if( $query->have_posts() ) {
      while( $query->have_posts() ) {
        $query->the_post(); 
        $amount= get_field('amount',$id);
        $case = get_field('case',$id);
        $transaction_id = get_field('transaction_id',$id);
        $date = get_field('transaction_date',$id);

        $email = get_field('email',$id);
        if($email == '') {
          $email = $current_user->user_email;
        }
        if ( is_user_logged_in() ) {
          $name = $current_user->first_name;
        } else {
          $name = get_field('name',$id);
        }
        $admin_email = get_option( 'admin_email' );

        $to_ = $email;
        file_put_contents('data.txt', $to_);
        $from_mail = "info@kochikids.org";
        $subject = "Confirmation - Kochi Kids";
       
$msg_user= '
    <table width="700" style="border-collapse:collapse;border:1px solid #444;">
      
      <tbody>
          <tr>
<th colspan="2"><a href="'. get_site_url().'" target="_blank" style="color: #dc3779;"><img src="'.get_stylesheet_directory_uri().'/img/mail-template.jpg"></a></th>
</tr>
       <tr>
         <td colspan="2" colspan="2" style="padding:7px 15px;border:1px solid #444;">Thank you for contacting Kochi Kids. We have successfully received your payment.The details of your Contribution are provided below for your reference:</td>
        </tr>
        <tr>
          <td style="padding:7px 15px;border:1px solid #444;">Name:</td>
          <td style="padding:7px 15px;border:1px solid #444;">'.$name.'</td>
        </tr>
        <tr>
          <td style="padding:7px 15px;border:1px solid #444;">Amount:</td>
          <td style="padding:7px 15px;border:1px solid #444;">CAD '.$amount.'</td>
        </tr>
         <tr>
          <td style="padding:7px 15px;border:1px solid #444;">Cause:</td>
          <td style="padding:7px 15px;border:1px solid #444;">Contribute for '.$case->post_title.'</td>
        </tr>
        <tr>
          <td style="padding:7px 15px;border:1px solid #444;">Transaction ID:</td>
          <td style="padding:7px 15px;border:1px solid #444;">'.$transaction_id.'</td>
        </tr>
        <tr>
          <td style="padding:7px 15px;border:1px solid #444;">Transaction Date:</td>
          <td style="padding:7px 15px;border:1px solid #444;">'.$date.'</td>
        </tr>
 
      </tbody>
      <tfoot style="text-align: center;background-color: #dc3779;">
        <tr>
          <td colspan="2" style="color: #ffffff;padding:7px 15px;">
            <a href="'. get_site_url().'"  target="_blank" style="color: #fff;">Kochi Kids</a>
          </td>
        </tr>
      </tfoot>
    </table>';


    $mail2 = new PHPMailer(true);
    try {
        //Server settings
        //$mail2->SMTPDebug = SMTP::DEBUG_SERVER;                      //Enable verbose debug output
        $mail2->isSMTP();                                            //Send using SMTP
        $mail2->Host       = 'mail.kochikids.org';                     //Set the SMTP server to send through
        $mail2->SMTPAuth   = true;                                   //Enable SMTP authentication
        $mail2->Username   = 'info@kochikids.org';                     //SMTP username
        $mail2->Password   = '{iXTZ%J%#RP8';                              //SMTP password
        $mail2->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;            //Enable implicit TLS encryption
        $mail2->Port       = 465;                                    //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
        //Recipients
        $mail2->setFrom('info@kochikids.org');
        $mail2->addAddress($to_);
        if($from_mail){
            $mail2->addReplyTo($from_mail);
        }
        $mail2->isHTML(true);
        $mail2->Subject = $subject;
        $mail2->MsgHTML($msg_user);
        $send = $mail2->send();
    }catch (Exception $e) {
         echo "Message could not be sent. Mailer Error: {$mail2->ErrorInfo}";
    }
}//end the while loop

}// end of the loop.