Need to set up a Confirmation Email script

Hi there. I’ve been reading up on lots of tutorials on how to do this, but I’m stuck. I need to set up a script that will send out a confirmation email to the user’s email when they submit a form on my website. Here is the code of my contact.php that submits the contact form information fine, but I’m having real trouble getting a confirmation script to work with this.

[code]<?PHP
/*
Contact Form from HTML Form Guide
This program is free software published under the
terms of the GNU Lesser General Public License.
See this page for more info:
http://www.html-form-guide.com/contact-form/simple-php-contact-form.html
*/
require_once("./include/fgcontactform.php");

$formproc = new FGContactForm();

//1. Add your email address here.
//You can add more than one receipients.
//$formproc->AddRecipient(‘[email protected]’); //<<—Put your email address here
$formproc->AddRecipient(‘[email protected]’);

//2. For better security. Get a random tring from this link: http://tinyurl.com/randstr
// and put it here
$formproc->SetFormRandomKey(‘WRHjcspe5UGGCtJ’);

if(isset($_POST[‘submitted’]))
{
if($formproc->ProcessForm())
{
$formproc->RedirectToURL(“thank-you.php”);
}
}

?>

Contact us Contact us
* required fields
<?php echo $formproc->GetErrorMessage(); ?>
Your Full Name*:
' maxlength="50" />
Email Address*:
' maxlength="50" />
Phone Number*:
' maxlength="15" />
Message:
<?php echo $formproc->SafeDisplay('message') ?>
[/code]

I’m on a bit of a time crunch, so if someone could help me out, I’d really, really appreciate it.

Thank you so much!

~Saito

Have you made a confirmation script yourself?

The way I would do it would be to save the form’s response, send an e-mail with a link and then when the user clicks the link they would be sent to a page that sends off the form. This might be a bit tricky with the FGContactForm class you’re using.

I’ll make sure to keep this under my belt, but I’ve already figured it out.

Sponsor our Newsletter | Privacy Policy | Terms of Service