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="lee@mymail.com";
$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  :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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