public string SubscribeEmail(string EmailId) { if (IsEmailValid(EmailId)) { string ipAddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(ipAddress)) { ipAddress = Request.ServerVariables["REMOTE_ADDR"]; } Coupons objCoupons = new Coupons(); if (objCoupons.SubscribeEmail(EmailId, ipAddress) == true) { return "Thanks for subscribing"; } else { return "Error occured, please try later"; } } else { return "Please enter valid email address"; } }
tags: