<?php

	include "funcs.php";

	$ip = $HTTP_SERVER_VARS["REMOTE_ADDR"];
	$iprange = trim(substr($ip,0,10));
	if ($iprange != "151.9.115.")
	{
		die();
	}

	$RetRecurringId = $HTTP_POST_VARS['recurring_ID'];

	$validato = 0;
	if ($RetRecurringId > 0)
	{
		$validato = 1;
	}

	if ($validato == 1) {
		
		$mail_to = "<<1-email_ordini>>";

		$sendmail_from = $mail_to;

		$sendmail_subject = "Notifica pagamento ricorrente " . $RetRecurringId;
		$sendmail_replyto = $mail_to;

		$info = "Pagamento ricorrente\n";
		$info .= "Recurring_ID: " . $RetRecurringId ."\n";

		mail($mail_to, $sendmail_subject, $info, "From: " . $sendmail_from . "\r\n" . "Reply-To: " . $sendmail_replyto . "");

	}
		
?>

<HTML>
<BODY>
</BODY>
</HTML>