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:
then change :
$GoToPage = "thankyou.php";
$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.