Jump to content

Newbie here, trying to build a contact form with a mailer


synergyworks

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.