Jump to content

Feedback email php form


ang31

Recommended Posts

I have spent countless hours testing and editing my email php but it does not work at all. I bought a web template that had this feature and normally it's fairly simple to edit but this was not the case. I have yet to hear a response from the creator of the template. Below is the contents of both corresponding files for a flash website. Someone please let me know if there is a simple mistake I am just over-looking. Any feedback is greately appreciated. email.php file contents------------------------<?$to="myemailaddress@gmail.com";$name=$_POST['name1'];$from = 'myotheremailaddress@gmail.com';$email=$_POST['email'];$phone=$_POST['number'];$subject=$_POST['subject'];$message=$_POST['message'];$header="From: $from\n";$mes="your name: $name\ne-mail: $email\nphone: $phone\nsubject: $subject\nmessage: $message\n";mail($destination,$subject,$mes,$header); -------------------------cgal.xml file contents <?xml version="1.0" encoding="utf-8"?><data><title>FEEDBACK</title><request field1="your name*" field2="e-mail*" field3="phone" field4="subject" field5="message*">email.php</request><description><![CDATA[<font color="#6c6e74">Feedback form is not functioning yet. Please use contact information from "contact info" link.</font>]]></description></data>

  • Like 1
Link to comment
Share on other sites

Guest So Called

Does not work at all? Just exactly what does that mean? Does your PHP script execute? You could echo some of those variables to see what they are. You can cut out or comment all that code and replace it with mail("myemailaddress@gmail.com", "subject", "message"); just to see if you get the email sent. If not then figure out why not. If so, then add in the rest of your stuff incrementally.

Link to comment
Share on other sites

You can obviously tell I'm a noob at this. By "does not work at all" I mean it simply does not work and I do not get an e-mail. I changed the opening tag from "<?" to "<?php" but it did not make a difference. I might be a little out of my league here. The bulk of what I usually do is replace the obvious in the code with the information I want, such as the "myemailaddress@gmail.com".

Edited by ang31
Link to comment
Share on other sites

then you have to step back and follow So Called advice. If you don't know what you're doing, trying to get a pile of code to work without understanding it is a recipe for distaster. Do what he said. Start of by executing mail with just hardcoded values, and make sure mail even works. Then add things in one by one. Don't assume anything. Verify line by line what your code is doing and figure out what the problem is.

Link to comment
Share on other sites

Guest So Called
You can obviously tell I'm a noob at this. By "does not work at all" I mean it simply does not work and I do not get an e-mail.
When requesting help on an Internet forum you need to supply ALL possible information about your problem. The better information you provide the better quality answers you will get. Try this: email.php
<?php $result = mail("myemailaddress@gmail.com", "subject", "message"); echo $result ? "success" : "failure"; ?>

That will tell you if your script is running at all, and it will tell you if your mail() executed successfully or failed. If it returned "success" but you got no email, then you know that the problem is downstream from your email.php script.' If it returned "failure" then you know there's a problem in the script. If you got no message at all then you know the script didn't get called. Or if you received an email then you can start adding more code to your script.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...