where it works in one environment, but not another, it ios probably not something you are doing wrong, but a server errror.
to troubleshoot the problem, add the following code at line 1:
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
then change :
$GoToPage = "thankyou.php";
to:
$GoToPage = "";
and add this code after the <body> tag:
<?php echo WA_DFP_AllUploadsDebug(); ?>
post back the results after sending another email, this will give me information for troubleshooting the issue.