<?php
if(isset($_POST['txtEmail']))
{
	$subject="stylishnestcorner.com NewsLetter Unsubscribe";
	$to=$_POST['txtEmail'];
	$headers  = 'MIME-Version: 1.0' . "\r\n";
	$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	$headers .= 'From: '.'noreply@stylishnestcorner.com';
	$message="Dear ".ucfirst($_POST['txtName']).",<br />You Have Successfully Unsubscribed From Our Newsletter<br /><br /><br />Thank You.<br />Team";
	if(@mail($to,$subject,$message,$headers))
	{
		echo "<script>alert('You Have Successfully Unsubscribed From Our Newsletter');</script>";
		echo "<script>window.location='".$_SERVER['HTTP_REFERER']."';</script>";
	}
	else
	{
		echo "<script>alert('Seems Wrong Email or Server Offline');</script>";
		echo "<script>window.location='".$_SERVER['HTTP_REFERER']."';</script>";
	}
	
}
else echo "<script>window.location='index.html';</script>";


?>