Bought the Fancy Form Design book but cannot get the form to send a confirmation email to the form submitter and the form owner.
I am using the feedback form example found in the code download. Where do I set up the email function or place the code to enable sending the confirmation email.
From what I know about PHP, that seems like a task for…well, PHP! Really anything to do with server-side requests and actions (generally speaking) uses PHP.
I don’t think that book covers PHP. But maybe I’m wrong?
~TehYoyo
Yes you’d have to write an email script to get that part working :).
If you even google some mail scripts you can surely find one. Here is my personal email script (the HTML page form sends me here)
<?php
$email=$_POST['email'];
$name =$_POST['name'];
$message = $_POST['message'];
$subject = $_POST['subject'];
$from = "PERSONAL EMAIL ADDRESS HERE";
$send = mail($from , $subject , "Someone wants to contact you through your website.\
\
The user who wants to is. \
\
User: ".$name."\
Email: ".$email."\
\
".$message."\
\
Your welcome", "FROM: donotrespond@ryanreese.us");
if ($send||isset($send)||!empty($send))
{
header('Location: http://www.ryanreese.us/confirmation.php?mail=sent');
} else if(!$send||empty($send)||!isset($send)) {
header('Location: http://www.ryanreese.us/contact.php?error=true');
}
?>
That code isn’t safe at all. I haven’t just gotten around to making it so though ;).
DO KEEP IN MIND…
( aside from sanitizing your data before using that script)
your host / and PHP configuration must allow this to happen.
A couple of years ago I tried to run a small test page locally ( directly of off my computer) and found out a couple of important things.
- Mac OSX.5 needs to have “postfix” configured… (read: google:‘postfix’ PHP mail. Warning: complex. MAMP PRO: good helper app for this)
- Your actual ISP must allow it. After I manually configured postfix. My script return “true” but I received no email. My ISP just simply did not allow for email to be sent via scripts.
Uploading to my commercial host. the VERY SAME script worked perfectly. In a nutshell, if you are doing this locally on your machine, you may already be doing the script right, but your PC or your ISP/ HOST is just not allowing for emails to be sent. Test from a remote host you know allows for emails.
My previous php script to send mail worked on my old form but will not work on this fancy form.
RyanReese I tried your script and pointed the form action to this script on a live server. I received no email but did get the thank you page generated by the java script.
It seems the best solution for now is to use PHP for the validation and sending mail. This book seems to use java script and css.
Thanks for the help guys. I will be going the PHP route.(I know it works)
As said before, that script is the exact one I use online. If it didn’t work for you, you didn’t make the HTML correct, or something. It’s probably your host or something. Did you set up an email account on your host to even have one to send emails from?