Jump to content

Help needed on; how to send a automatic reply email and post a subject line


leet8845

Recommended Posts

Hi there,

 

Currentley my PHP code doesnt post a subject line for the email it creates. I want a set subject e.g 'web site contact form01' to be posted with the email my code generates. Is thispossible, if so how?

 

Another thing I wish to do is send a automatic confirmation reply email to the sender. Is this possible with my current code?

 

Any help with either of these, is truly appreciated!

 

My code;

 

<?php
// Check email is not empty
if (! empty ($_POST['Email']) )
{
// Check name is not empty
if (! empty ($_POST['Name']) )
{

// Getformdataandcreateemail
$Email2="[email protected]";
$email=$_POST['Email'];
$name=stripslashes($_POST['Name']);
$name2=stripslashes($_POST['Name2']);
$date=stripslashes($_POST['Date']);
$number=stripslashes($_POST['Number']);
$location=stripslashes($_POST['Location']);
$destination=stripslashes($_POST['Destination']);
$requirements=stripslashes($_POST['Requirements']);
$hear=stripslashes($_POST['Hear']);
$other=stripslashes($_POST['Other']);
$message=
<<<EOD
--------------------------------
Enquiry from your website 
--------------------------------

Name: $name
Name2: $name2
EmailAddress: $email
Number: $number
Location: $location
Destination: $destination
Date: $date
Requirements: $requirements
Hear about us: $hear
Other: $other

--------------------------------
End of Message
--------------------------------
EOD;

//Sendemail
@mail($Email2,$subject,$message, "From:$Email2");
header("Location: http://www.mysite.com/error.html");

}
else
{
    // No email was sent
    header("Location: http://www.mysite.com/error.html");
}

}
else
{
    // No name was sent
    header("Location: http://www.mysite.com/error.html");
}

?>

 

Thanks for lookin  :)

Add before this line:

@mail($Email2,$subject,$message, "From:$Email2");

 

This-

$subject = "web site contact form01";

 

 

I guess your coder forgot to do that.

What do you mean by automatic confirmation? These emails are being sent automatically...

 

 

Orio.

Thanks that worked perfect for the subject :)

 

Sorry for not being clear, what I mean is a automatic confirmation email to be sent to the person who sends the form. Is the possible to be done on my code?

 

Many Thanks.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.