我上设置通过我的PayPal IPN脚本自动发送的电子邮件的响应,但是工作下面的代码将导致PayPal的沙盒失败。PHP邮件功能造成的错误
// PAYMENT VALIDATED & VERIFIED!
$email = $_POST['payer_email'];
$password = mt_rand(1000, 9999);
$to = $email;
$subject = 'Download Area | Login Credentials';
$message = '
Thank you for your purchase
Your account information
-------------------------
Email: '.$email.'
Password: '.$password.'
-------------------------
You can now login at http://yourdomain.com/PayPal/';
$headers = 'From:[email protected]<script type="text/javascript">
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
</script>' . "\r\n";
mail($to, $subject, $message, $headers);
是否存在某种简单错误或脚本导致错误的更深层原因。请记住,我是新手,这是我从http://code.tutsplus.com/tutorials/using-paypals-instant-payment-notification-with-php--net-3271复制并粘贴的代码。
此外,没有从该电子邮件我使用必须位于我使用主办的脚本在同一台服务器上?
删除邮件以避免泄露个人信息。
什么错误? –
请不要在邮件中以明文形式发送任何密码。 –
作为参考,IPN沙盒不会告诉我错误是什么,我只知道它不起作用。 –