Paypal IPN Solution dosen't work since one month

software development



I’m having problems (since one month more or less) with Paypal Ipn Solution.

My clients, after purchasing, dosen’t receive the email I send using the ipn.php script.

I don’t know why it dosen’t work anymore, because it was working fine since two years.

Hear is my script (I quit the sending mail code):

<?php //------------------------------------------------ // Read post from PayPal system and create reply // starting with: 'cmd=_notify-validate'... // then repeating all values sent - VALIDATION. //------------------------------------------------ $postvars = array(); while (list ($key, $value) = each ($HTTP_POST_VARS)) { $postvars[] = $key; } $req = 'cmd=_notify-validate'; for ($var = 0; $var < count ($postvars); $var++) { $postvar_key = $postvars[$var]; $postvar_value = $$postvars[$var]; $req .= "&" . $postvar_key . "=" . urlencode ($postvar_value); } //-------------------------------------------- // Create message to post back to PayPal... // Open a socket to the PayPal server... //-------------------------------------------- $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen ($req) . "\r\n\r\n"; $fp = fsockopen ("", 80, $errno, $errstr, 30); //---------------------------------------------------------------------- // Check HTTP connection made to PayPal OK, If not, print an error msg //---------------------------------------------------------------------- if (!$fp) { $res = "FAILED"; } //-------------------------------------------------------- // If connected OK, write the posted values back, then... //-------------------------------------------------------- else { fputs ($fp, $header . $req); //------------------------------------------- // the results of the verification... // If VERIFIED = continue to process the TX... //------------------------------------------- while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { if ($item_number == 1) { // -------------------------------------- Here I send the email -------------------------------------- } } else { ; } } } fclose ($fp); ?>


I think I have isolated (but not solved) the error.

If I created a php and I run it on my server having:

if (mail(“here I wrote my gmail email”, “try”, “try”))
echo “email 0k”;
echo “email NO”;

The script echoes “email Ok”, but dosen’t arrive to my email. I also tried this: mail(‘here I wrote my gmail email’, ‘try’, ‘try’). It echoes again “email Ok”, but the email dosen’t arrive.

Whi is not working “PHP mail()”??? Any suggestions, please?

Thank you in advance!


Other posts today on these forums report the same thing: PHP mail() is not working for some … I suggest you generate a support ticket. :wink:



To make life easier for yourself in the future, you should change this:while (list ($key, $value) = each ($HTTP_POST_VARS)) {into this:while (list ($key, $value) = each ($_POST)) {$HTTP_POST_VARS was deprecated about eleventy-billion years ago. It is not available in DreamHost’s PHP5 setup, and it will not exist in PHP6 at all.

Max discount on any plan with promocode SCJESSEYTOTAL


php mail() not working => Ok, thanks!

$_POST => Hey!, thanks!

I hope the mail() problem will fixed soon!