jakeselectronics
New Member
- Messages
- 38
- Reaction score
- 0
- Points
- 0
I had a working Contact form and now it has parcially stopped working.
I have the form on my site, and what it would do is send me an email, as well as the person who sent it. Like an auto reply confirmation email to them.
I have been sitting here all day trying to figure out whats wrong and I still am not sure.
I have norrowed it down though.
When i take the '$from' bit out of this: $send = mail($to, $subject, $body, $from);
It works.
But the email ends up in my junk folder. without a from address. Which is annoying because i cant just hit reply.
and when its included ( '$from' ), i dont get an email at all.
here's the whole .php code:
Can anyone see anything obvioulsy wrong.
And here's my webpage for the contact form..
http://jakeselectronics.x10hosting.com/contact.php
I have the form on my site, and what it would do is send me an email, as well as the person who sent it. Like an auto reply confirmation email to them.
I have been sitting here all day trying to figure out whats wrong and I still am not sure.
I have norrowed it down though.
When i take the '$from' bit out of this: $send = mail($to, $subject, $body, $from);
It works.
But the email ends up in my junk folder. without a from address. Which is annoying because i cant just hit reply.
and when its included ( '$from' ), i dont get an email at all.
here's the whole .php code:
Can anyone see anything obvioulsy wrong.
PHP:
<?php
if (isset($_POST['submit'])){
$name = $_POST['name'];
$email = $_POST['email'];
$subjectabout = $_POST['subject'];
$mailinglist = $_POST['list'];
$message = $_POST['message'];
$to = "jephpform@hotmail.com";
$subject = "JE - Result From Web Form";
$from = "From: $name <$email>";
$body = "Name: $name\nE-Mail: $email\nSubject: $subjectabout\nAdd to Mailing list: $mailinglist\nMessage:\n\n $message";
$autoreplymessage = "Thanks $name for contacting me.\nI will get back to you as soon as possible.\n\n\nThe following information was sent:\n$body";
$autoreplysubject = "Thank you for contacting Jake";
$autoreplyheader = "From: NoReply - Jake's Electronics <noreply@jakeselectronics.com>";
if($name == '')
{header( "Location: http://jakeselectronics.x10hosting.com/con-incomplete.php" );}
else {
if($email == '')
{header( "Location: http://jakeselectronics.x10hosting.com/con-incomplete.php" );}
else {
if($message == '')
{header( "Location: http://jakeselectronics.x10hosting.com/con-incomplete.php" );}
else {
$send = mail($to, $subject, $body, $from); // This sends an email to me
$send2 = mail($email, $autoreplysubject, $autoreplymessage, $autoreplyheader); // This sends an email to them
if($send)
{header( "Location: http://jakeselectronics.x10hosting.com/con-thanks.php" );}
else
{header( "Location: http://jakeselectronics.x10hosting.com/con-error.php" );}
}
}
}
}
?>
And here's my webpage for the contact form..
http://jakeselectronics.x10hosting.com/contact.php