I'm having trouble with trying to get an auto-reply working suing the mail(); function.
So far I have this:
<?php
if (isset($_POST['contact_name']) && isset($_POST['contact_email']) && isset($_POST['contact_text']))
{
$contact_name = $_POST['contact_name'];
$contact_email = $_POST['contact_email'];
$contact_subject = $_POST['contact_subject'];
$contact_text = $_POST['contact_text'];
if(!empty($contact_name) && !empty($contact_email) && !empty($contact_subject) && !empty($contact_text)){
$to = 'me@live.ie';
$subject = $contact_subject;
$body = 'From: '.$contact_name."\n\n".$contact_text;
$headers = 'From: '.$contact_email;
$subject1 = 'Thank you for contacting...';
$autoreply = "Thank you for contacting...";
$headers1 = "From: me@me.ie";
if (mail($to, $subject, $body, $headers)){
if (mail($contact_email, $thanks{
}
echo 'Thank you. Your e-mail has been sent.';
}
else{
echo 'Sorry, an error occurred, please try again later';
}
} else{
echo 'All fields must be filled in';
}
}
?>
Now, I do realise that the following have not yet been put into a mail(); function
$subject1 = 'Thank you for contacting...';
$autoreply = "Thank you for contacting...";
$headers1 = "From: me@me.ie";
But where do I make the second mail function?
Basically, it's for a contact form, and when the user submits the contact form, the admin will get the details of that form submitted, but then I want the user to also receive an e-mail from me saying that we have received their contact form and that we will be with them shortly.
Anyone know how to do this?
EDIT: Sorry, I put this in the wrong section of the forums, I'm quite tired
Edited by GaryORLFC, 09 May 2012 - 04:28 PM.