synergyworks Posted May 31, 2014 Share Posted May 31, 2014 Can anyone find a glaring error with my contact form or my mailer? I previously had a form that was working (sending the email through) but stopped working. It was more complicated before and had a recaptcha in it. I've been troubleshooting this for awhile now and can't figure out what's happening. I've stripped it down to just the basics. I'm stumped because I am correctly redirected to the confirmation.html page, yet no email has come through. I even put a simple test file (mailertest.php) on the server. The file is found and echoes "Mail sent", but no email is received. I contacted the host and they claim that things are fine on their end with the PHP mailer and it must be a problem in my code. As a newbie, I don't doubt that I'm doing something wrong, but I can't figure it out! I'm attaching three files. Contact.php, contact_mailer.php and my test PHP file called mailertest.php. I'd appreciate any help that anyone can offer. mailertest.php contact_mailer.php contact.php Quote Link to comment Share on other sites More sharing options...
fastsol Posted May 31, 2014 Share Posted May 31, 2014 Based on your code I would imagine that it's likely a header issue. You should really look at using a mailer library like phpmailer. It has all the stuff built in to help with email delivery. Believe me from personal extensive experience with emailing in php, it's not as simple as using the mail function to guarantee delivery to your email client or even harder your inbox. I distribute a nice contact form that utilizes the phpmailer library at http://amecms.com/article/Easy-to-use-contact-form-with-validation which has full validation and ajax sending. At the very least you can look at the code to understand how much it takes to make all this work properly. Quote Link to comment Share on other sites More sharing options...
synergyworks Posted June 1, 2014 Author Share Posted June 1, 2014 Thank you, I am looking into this. Can you recommend a tutorial that would help me understand what phpmailer does and how to apply it? Thank you. Quote Link to comment Share on other sites More sharing options...
Frank_b Posted June 1, 2014 Share Posted June 1, 2014 (edited) if i look to your test mail it seems that your provider does not support the PHP mail() function or that the mail configuration of the server is not right configured. Edited June 1, 2014 by Frank_b Quote Link to comment Share on other sites More sharing options...
fastsol Posted June 1, 2014 Share Posted June 1, 2014 http://www.youtube.com/playlist?list=PLfdtiltiRHWEM8SBc7fahXQJrUy9xmFYW Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.