Hi, I am new to php, and i am writting a script that will take a forms details and send them back to a compaines email adress.
Everything works fine except for getting it to display a from address. Instead it displays the servers address. I have searched high and lo and have had no luck 🙁 I have enclosed my code below. Could anyone tell me where i am going wrong as i am totally bamboozeled 🙁(
<HTML>
<?php
$to = "Andrew@webtailoruk.com";
$from = "WebSite Enquiry";
$subject = "Modern Screws Enquiries";
$additional = "";
if(isset($from) and strlen($from))
{
$additional .= "From: " . $from;
}
$message = "Dear Staff of Modern Screws,
\r\n My name is : $name
\r\n My E-mail Address is: $email
\r\n My Contact Number is: $phone
\r\n My Sector is: $sector
\r\n My Enquiry is as follows: $enquiry
\r\n Many thanks for your time.
Kind Regards \r\n \r\n $name";
mail( $to, $subject, $message, $additional ) or print "Could not send mail.";
?>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.Modern-Screws.co.uk">
</BODY>
</html>
Mnay thanks for your time.