Forum Moderators: coopster

Message Too Old, No Replies

php mail function

         

jotek

9:35 pm on Oct 15, 2009 (gmt 0)

10+ Year Member



PHP mail function stopped working. I'm assuming it has something to do with the way my php.ini file is set up but I don't have access to it yet. Can someone check my code php mail script to make sure I got it set up right?


<form id="form1" name="form1" method="post" action="send_info.php">
<div align="center">
<legend class="tablecontent">First Name</legend>
<input type="text" name="FirstName" id="First Name" />
</div>
<div align="center">
<legend class="tablecontent">Last Name</legend>
<input type="text" name="LastName" id="Last Name" />
</div>
<div align="center">
<legend class="tablecontent">Email Address</legend>
<input type="text" name="Email" id="Email Address" />
</div>
<p align="center"><input type="image" src="images/Download_button.jpg" value="submit" width="100" height="20" /></p>
</form>


<?php
$first_name = $_POST['FirstName'] ;
$last_name = $_POST['LastName'] ;
$email = $_POST['Email']

$Body = "";
$Body = "First Name: ";
$Body = $first_name;
$Body = "Last Name";
$Body = $last_name;
$Body = "Email: ";
$Body = $email;

$headers = "From: $email";

mail( "me@email.com", "Contact Info", $Body, $headers );
header( "Location: http://www.example.com/thankyou.html" );
?>

kamperzoid

10:36 pm on Oct 15, 2009 (gmt 0)

10+ Year Member



I see a problem with $Body only the variable $email is in it at the end.

use $Body .= <and your variables>

this wil solve part of your problem

greetz Kamperzoid

kamperzoid

10:38 pm on Oct 15, 2009 (gmt 0)

10+ Year Member



Found something else

$email = $_POST['Email']

There is no ; so that will stop the script.