简体   繁体   中英

Not sending email after paypal verification

I have set up IPN properly but still cannot get it to send an email. Part of my code from ipnlistener.php which I'm assuming is wrong:

$code = md5($_COOKIE["AlphaEmail"]);

$to = $_COOKIE["AlphaEmail"]";
$subject = 'WTL Account Activation;
$message = 'Thank you for your purchase.\n\n http://www.worktheline.org/activate.php?code='.$code.';  $headers = 'From:noreply@worktheline.org' . "\r\n";

mail($to, $subject, $message, $headers);

The code before this segment is copied from here: https://developer.paypal.com/webapps/developer/docs/classic/ipn/ht_ipn/ so I guess I can safely assume that is all correct?

Check your web server logs and you should get details about why the mail is failing.

Another thing that can help is testing your IPN script in a browser so that you can see the result on screen (and make sure error reporting is enabled.)

To do this you can just create a basic HTML form with the action set to your IPN URL. Add hidden fields that match the names/values of IPN data you expect to get and then you can load it and submit it directly in a browser. This allows you to see the result and can help with troubleshooting.

Just keep in mind that when testing that way the IPN will not be verified since it didn't come from PayPal's server, so you'll want to make sure your code logic can handle that accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM