I don't know much about PHP. I hired a freelancer to create this for me and then after I noticed an issue, his account was closed on freelancer.com. So I'm no longer able to communicate with him. So any help is greatly appreciate. He created a system for me that automatically emails digital files to an eBay customer. It used the quantity and price information from PayPal IPN to do this. All of my digital files are one time use. So once a file is purchased on eBay, it gets emailed to the customer and then discarded. The system works great when a customer orders a quantity of 1.

The issue is when the customer orders more than 1. 2 scenarios happen: For example if a customer orders 2 digital files, lets says "XB1.pdf" and "XB2.pdf". Scenario 1 they will get "XB1.pdf" in an email and sometimes get "XB2.pdf" in a second email, but the email is filled with a bunch of giberish (I posted the email contents to the bottom of the ipn.php contents below). Scenario 2 sometimes they will get 2 emails but both contain "XB1.pdf" only and not "XB2.pdf". Can you look at the code and see if you can spot the issue? This is the ipn.php file contents and i believe this is where the issue is.

ipn.ph contents

<?php namespace Listener;

include('config.php');

// Set this to true to use the sandbox endpoint during testing:
$enable_sandbox = true;

// Set this to true to send a confirmation email:
$send_confirmation_email = true;

}}}else {
$oka = @mail($mail_me, "No File Found", "HI,<br>".$payer_email." has made a payment of ".$total_payment." but coupon could not be found.");

}

}

// Reply with an empty 200 response to indicate to paypal the IPN was received correctly
header("HTTP/1.1 200 OK");

trash email contents, this is only a portion of it since it is very long

Write anything you want here. This will be the body of the email that is sent. This is a multi-part message in MIME format. --==Multipart_Boundary_xad2df9824fad4231989b39a4240b752ex Content-Type:text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Write anything you want here. This will be the body of the email that is sent. --==Multipart_Boundary_xad2df9824fad4231989b39a4240b752ex Content-Type: application/pdf; name="566222_XL-48Hour_3.pdf" Content-Disposition: attachment; filename="566222_XL-48Hour_3.pdf" JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFu Zyhlbi1VUykgL1N0cnVjdFRyZWVSb290IDEyIDAgUi9NYXJrSW5mbzw8L01hcmtlZCB0cnVlPj4+ Pg0KZW5kb2JqDQoyIDAgb2JqDQo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1sgMyAwIFJdID4+ DQplbmRvYmoNCjMgMCBvYmoNCjw8L1R5cGUvUGFnZS9QYXJlbnQgMiAwIFIvUmVzb3VyY2VzPDwv Rm9udDw8L0YxIDUgMCBSL0YyIDkgMCBSPj4vRXh0R1N0YXRlPDwvR1M3IDcgMCBSL0dTOCA4IDAg Uj4+L1Byb2NTZXRbL1BERi9UZXh0L0ltYWdlQi9JbWFnZUMvSW1hZ2VJXSA+Pi9NZWRpYUJveFsg MCAwIDYxMiA3OTJdIC9Db250ZW50cyA0IDAgUi9Hcm91cDw8L1R5cGUvR3JvdXAvUy9UcmFuc3Bh cmVuY3kvQ1MvRGV2aWNlUkdCPj4vVGFicy9TL1N0cnVjdFBhcmVudHMgMD4+DQplbmRvYmoNCjQg MCBvYmoNCjw8L0ZpbHRlci9GbGF0ZURlY29kZS9MZW5ndGggMTc1Nz4+DQpzdHJlYW0NCniclVht b5tIEP4eKf9h++UEp8uGXXYXqKpKbdKmOTXXKPFVkar7QGzsoNjGApzU//5mBkjA9bprVW0NzM7r

When you hire someone, always get as many ways to contact them as possible. I know someone who had to hire a private investigator to find the designer that created his company's branding. He had lost all his files. The company the designer used to work for had lost all their files too. The only hope was finding the original designer and hoping he still had the original design files.