Need Help PHP Contact Form "Success" But Not Receiving Email


#1
<?php
// Information to be modified
$to_email = "[redacted]"; // email address to which the form data will be sent
$subject = "Landing Page Contact Request"; // subject of the email that is sent
$thanks_page = "index.html"; // path to the thank you page following successful form submission
$contact_page = "index.html"; // path to the HTML contact page where the form appears


$nam = strip_tags($_POST["contact_name"]);
$ema = strip_tags($_POST["contact_email"]);
$com = strip_tags($_POST["contact_message"]);	

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: <' .$ema. '>' . "\r\n";
$headers .= "Reply-To: ".$ema."\r\n";

$email_body = 
	"<strong>From: </strong>" . $nam . "<br />
	<strong>Email: </strong>" . $ema . "<br />	
	<strong>Message: </strong>" . $com;
	

// Assuming there's no error, send the email and redirect to Thank You page
	
if( mail($to_email, $subject, $email_body, $headers) ) {	
	echo '<i class="glyphicon glyphicon-ok"></i> Thank you ' .$nam. '. Your Email was successfully sent!';
} else {	
	echo '<i class="glyphicon glyphicon-remove"></i> Sorry ' .$nam. '. Your Email was not sent. Resubmit form again Please..';
}
die();

Page: app.fitsbydesign.com

Repsonse says “Email sent successfully” yet no emails are delivered.


#2

Hi @FitsByDesign,

Nothing is wrong with the code. Have you checked your email’s spam folder? If it isn’t there, consider contacting your web host, as it will be an issue with their mail server.

Good luck!


#3

Thank you - checked spa, I will contact web host immediately.

I have one more issue, I’m new will you PLEASE help me, I am not a coder and I have been working on this for 6 days, I am so exhausted.

The banner/words in this template move perfectly fine in the preview windows on all browsers but doesn’t work on the page. I even FTP the original demo index.html file and it doesn’t work either.

		<div class="triangle-bg">				
			<div id="about" class="banner-section container">
				<div class="row">
				
					<!-- Left Banner Text Begins -->					
					<div class="col-md-5 left-banner-text animated" data-animation="fadeInLeft" data-animation-delay="500">
						<!-- Banner Text Slider -->
						<div class="text-slider">
							<ul class="slide-text slides">
								<li class="capitalize"><h1 class="text-uppercase"><span class="text-extrabold">FITS BY DESIGN</span> THE APP FOR FASHION GRADS</h1></li>
								<li class="capitalize"><h1 class="text-uppercase"><span class="text-extrabold">THE FUTURE</span> OF FREELANCE FASHION DESIGN</h1></li>
								<li class="capitalize"><h1 class="text-uppercase"><span class="text-extrabold">SUSTAINABLY MINDED</span> &amp; SOLUTION BASED</h1></li>
							</ul>
						</div>		

Here is the demo preview: http://www.webduck.in/geekapp/layout1/slider/color-1/index.html
Here is my page: http://www.app.fitsbydesign.com


#4

Looks like your js/custom.js file is missing a lot of code, including the code responsible for that text slider. Here’s the one from the live demo:

http://www.webduck.in/geekapp/layout1/slider/color-1/js/custom.js


#5

DEAR GOD YOU ARE AN ANGEL! I could literally cry right now, I’ve been on so many forums, I’ve downloaded 5 different code editors, watched countless videos and the Author won’t respond - this template isn’t supported.

Do I simply save the file and FTP it over? I am so sorry I have no idea what to do, I can pay you to help me. :’(


#6

No problem! :slight_smile:

Looks like you should be fine saving the file and transferring it over with FTP. Then clear your browser cache and give the page a refresh, should start working.


#7

I will do it immediately and let you know!


#8

I copied the files and save it as a custom.js - FTP and overwrote the file, clear cache/browser. Still not working. But thank you, at least I know its not me and it’s beyond me ability. I worked very hard but I think I will just buy another one.


#9

I still don’t see the new changes. Make sure you’re saving it to this file:

http://www.app.fitsbydesign.com/js/custom.js

The correct code is as follows (notice how your current file is missing the “Text Slider” section):

$(window).load(function() {
	'use strict';
	$(".pageloader").delay(1000).fadeOut("slow");
	InitcssFix();
});
jQuery( document ).ready(function($) {
	'use strict';
	InitcssFix();
	
	/* ===================
	Animated Items
	=================== */	
	$('.animated').appear(function() {
		var elem = $(this);
		var animation = elem.data('animation');
		if ( !elem.hasClass('visible') ) {
			var animationDelay = elem.data('animation-delay');
			if ( animationDelay ) {
	
				setTimeout(function(){
					elem.addClass( animation + " visible" );
				}, animationDelay);
	
			} else {
				elem.addClass( animation + " visible" );
			}
		}
	});
	
	/* =============================
	Text Slider
	============================= */	
	$('.text-slider').easyTicker({
		direction: 'up',		
		speed: 'slow',
		interval: 3000,
		height: 'auto',
		visible: 1,
		mousePause: 0,		
	});
	
	/* =============================
	Carousel Slider
	============================= */	
	$("#app-screenshot").owlCarousel({
		items : 3,
		lazyLoad : true,
		autoPlay: false,
		navigation : true,
		navigationText: ['<i class="fa fa-chevron-left color-grey"></i>','<i class="fa fa-chevron-right color-grey"></i>'],		
		pagination: false,
		itemsCustom : false,
		itemsDesktop : [1199, 3],
		itemsDesktopSmall : [980, 3],
		itemsTablet : [768, 2],
		itemsTabletSmall : false,
		itemsMobile : [479, 1]
	});
	/* =============================
	Services Carousel Slider
	============================= */	
	$("#awesome-services").owlCarousel({
		items : 3,
		lazyLoad : true,
		autoPlay: true,
		navigation : false,
		pagination: false,
		itemsCustom : false,
		itemsDesktop : [1199, 3],
		itemsDesktopSmall : [980, 3],
		itemsTablet : [768, 2],
		itemsTabletSmall : false,
		itemsMobile : [480, 1]
	});
	
	/* ===================
	Scroll Navigation
	=================== */	
	$('.scroll').bind('click', function(event) {
		var $anchor = $(this);		
		
		$('html, body').stop().animate({					
			scrollTop : $($anchor.attr('href')).offset().top  + 2 + "px"
		}, 1200, 'easeInOutExpo');

		event.preventDefault();
		return false;
	});
	
	// Menus hide after click on mobile devices
	$('.nav li a').click(function () {
		 $('.navbar-collapse').removeClass('in');
		 return false;
	});
	
	/* ===================
	Fixed Menu on Scroll
	=================== */
	$("#sticky-menu").sticky({topSpacing:0});
	
	/* =============================
	Active Scrollspy Navigation
	============================= */	
	$('body').scrollspy({ 
	  target: '#topnav',
	  offset: 95
 	});
		
	/* =============================
	Contact Form Validation
	============================= */	
	$('#contactform').bootstrapValidator({
        message: '',
        feedbackIcons: {
            valid: 'fa fa-check',
            invalid: 'fa fa-times',
            validating: 'fa fa-refresh'
        },
        fields: {            
			contact_name: {
                validators: {
                    notEmpty: {
                        message: ''
                    }
                }
            },
			contact_email: {
                validators: {
                    notEmpty: {
                        message: ''
                    },
                    emailAddress: {
                        message: ''
                    }
                }
            },			
			contact_message: {
                validators: {
                    notEmpty: {
                        message: ''
                    }                    
                }
            }
        },
		submitHandler: function(validator, form, submitButton) {
						
			var data = $('#contactform').serialize();
			
			$.ajax({
					type: "POST",
					url: "process.php",					
					data: $('#contactform').serialize(),
					success: function(msg){						
						$('.gk-form-message').html(msg);
						$('.gk-form-message').show();
						submitButton.removeAttr("disabled");
						resetForm($('#contactform'));						
					},
					error: function(msg){						
						$('.gk-form-message').html(msg);
						$('.gk-form-message').show();
						submitButton.removeAttr("disabled");
						resetForm($('#contactform'));
					}
             });
			 
			return false;
        },
    });
	$('#subscribe').bootstrapValidator({
        message: '',
        feedbackIcons: {
            valid: 'fa fa-check',
            invalid: 'fa fa-times',
            validating: 'fa fa-refresh'
        },
        fields: {            
			subscribe_email: {
                validators: {
                    notEmpty: {
                        message: ''
                    }
                }
            }			
        },
		submitHandler: function(validator, form, submitButton) {
						
			var data = $('#subscribe').serialize();
			
			$.ajax({
					type: "POST",
					url: "subscribe.php",					
					data: $('#subscribe').serialize(),
					success: function(msg){						
						$('.gk-form-message-subscribe').html(msg);
						$('.gk-form-message-subscribe').show();
						submitButton.removeAttr("disabled");
						resetForm($('#subscribe'));						
					},
					error: function(msg){						
						$('.gk-form-message-subscribe').html(msg);
						$('.gk-form-message-subscribe').show();
						submitButton.removeAttr("disabled");
						resetForm($('#subscribe'));
					}
             });
			 
			return false;
        },
    });
	function resetForm($form) {
		$form.find('input:text, input:password, input, input:file, select, textarea').val('');
		$form.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected');		
		$form.find('input:text, input:password, input, input:file, select, textarea, input:radio, input:checkbox').parent().find('.form-control-feedback').hide();
	}
	
	/* =============================
	Color Panel
	============================= */	
	// Theme Panel Open/Close
	$( "#theme-panel .panel-button" ).click(function(){
		$( "#theme-panel" ).toggleClass( "close-theme-panel", "open-theme-panel", 1000 );
		$( "#theme-panel" ).toggleClass( "open-theme-panel", "close-theme-panel", 1000 );
		return false;
	});
	
	/* =============================
	Count Section
	============================= */	
	$(".count-number").appear(function(){
		$(this).each(function(){
			var datacount = $(this).attr('data-count');
			$(this).find('.counter').delay(6000).countTo({
				from: 10,
				to: datacount,
				speed: 3000,
				refreshInterval: 50,
			});
		});
	});
	
	/* ===================
	Video Script
	=================== */
	$(".player").mb_YTPlayer();
		
});
$(window).resize(function() {
	'use strict';
	InitcssFix();
});

/* ===============================
 CSS Fix for Background Shapes
=============================== */
function InitcssFix() {	
	var width = $(window).width();
	
	if( width >= 1480 && width < 1600 ) {
		$('.wrapper-class').addClass('after-1500');
		$('.wrapper-class').removeClass('after-1600');
	} else if( width >= 1600 && width < 1800 ) {
		$('.wrapper-class').addClass('after-1600');
		$('.wrapper-class').removeClass('after-1500');
		$('.wrapper-class').removeClass('after-2000');
	} else if( width >= 1800 && width < 2000 ) {
		$('.wrapper-class').addClass('after-1800');
		$('.wrapper-class').removeClass('after-1600');
		$('.wrapper-class').removeClass('after-2000');
	} else if( width >= 2000 && width < 2600 ) {
		$('.wrapper-class').addClass('after-2000');
		$('.wrapper-class').removeClass('after-1600');
		$('.wrapper-class').removeClass('after-1800');
		$('.wrapper-class').removeClass('after-2600');
	} else if( width >= 2600 && width < 3000 ) {
		$('.wrapper-class').addClass('after-2600');
		$('.wrapper-class').removeClass('after-2000');
		$('.wrapper-class').removeClass('after-3000');
	} else if( width >= 3000 ) {
		$('.wrapper-class').addClass('after-3000');
		$('.wrapper-class').removeClass('after-2600');
	} else if( width <= 1480 ) {
		$('.wrapper-class').removeClass('after-1500');		
	}
	
}

#10

Ok, I will do it now, the system just hid my post because they think I’m spam. I don’t know if I’ll be able to reply after this or if you will get this message. I will reply tomorrow if I’m locked out and I don’t want to overstay my welcome, you have been the only person to help me, forgive me if I am overwhelming you.


#11

I see the text slider code - but nothing has changed, I don’t think smart enough in this area. I appreciate your patience so very much. I’ll keep trying.


#12

I still don’t see it there, to be honest. The server also says that the custom.js file hasn’t been modified since March 20, for me.

image



#13

I just went through all the steps again. I don’t know how to send that file to you like you sent it to me


#14

I’m looking here:
http://www.app.fitsbydesign.com/js/custom.js


#15

I am using Brackets to edit it, and Filezilla to FTP


#16

Ah, look on the right side, you’ll see “remote site” is set to /public_html/color-1/js. I think you should be in public_html/js/ instead. :slight_smile:


#17

I just did it, did it work? Bailey theyve blocked me from talking for 22 hours, I am praying you see this:

OMMMMGGGGGGGG!!! BAILEY YOU ARE MY HERO!!! Can I PLEASE PAYPAL YOU or SOMETHING! OMG, You are THE MOST BRILLIANT MODERATOR EVER! Where can I sing your praises!!! Who can I write on your behalf! How do I reward you, give you likes, badges…whatever you guys give here!!

Ha, I found a cheat code to reply - editing! :stuck_out_tongue_closed_eyes:

But seriously, If you provide tech support/free lance PLEASE let me know. I am doing every aspect of my business on my own and I can not lie, this part is hard. I am so proud of myself, but my business is out growing me as a tech person. PLEASE let know if you’re available in any capacity, I would be grateful and happy to have you.


#18

Yup, your text slider is working for me now! :smiley:


#19

Thanks so much! I can certainly sympathize with your pain over the last week and am happy I was able to help you sort it out. Your appreciation is enough for me. :slight_smile:

Have a nice evening!


#20

BAILEY!! I just had to come back and tell you thank you again. You not only helped me that day but you’ve helped me in general. Realizing that there was no way I could have solved that issue (given my limited knowledge with coding) was a huge eye opener. I’ve stopped wasting as much time - I try everything in my arsenal once, then twice and then I get help.

You were so very patient and willing to help me that whenever I can, I must do/be the same for someone else.

Thank you again my hero! Bailey for President!! :smiley::hugs::+1: