php email form shows 'on behalf of' to outlook

Soldato
Joined
25 Jan 2007
Posts
4,738
Location
King's Lynn
I'm using a php based contact form on my site but it has an 'annoying' issue that I would like to fix...

The form works, it sends the message as required, all the validation etc works too but when I receive the message in outlook 2010 it shows
Server details on behalf of 'name of sender' <[email protected]> in the header.

Is there any way to remove the first bit (server details - not very secure) so all I have left is the name of sender and the email address. It doesn't have the issue in hotmail so it's clearly an outlook 'issue'.

I've read about an -f flag which might help but can't seem to find much about this.

Thanks in advance :)
 
Soldato
OP
Joined
25 Jan 2007
Posts
4,738
Location
King's Lynn
You're right about php being a sod to learn, html/css (well what I need) is fairly easy but for some reason php just seems completely alien lol

Is it the pear mail.php plugin... not sure, pear is an option in cpanel but theres also apache, the server is linux based if that helps..

Code below, yeah not the most fancy and validation is 'currently' javascript, I'm not quite up to speed on php validation.... one baby step at a time lol
PHP:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$subject = "Message from Website";
$name = $_POST['name'] ;
$address = $_POST['address'] ;
$postcode = $_POST['postcode'] ;
$dayno = $_POST['dayno'] ;
$email = $_POST['email'] ;
$query = $_POST['query'] ;
$other = $_POST['other'] ;
$approxsize = $_POST['approxsize'] ;
$comments = $_POST['comments'] ;
 

$output = 
"Message from Contact Form \n\nSubmitted From: $ip \n\nQuery Type: $query \nOther: $other \n\nName: $name \nDaytime Number: $dayno \nEmail Address: $email \n\nAddress:\n $address  \nPostcode: $postcode \n\nComments:\n $comments \n\nApproximate Size: \n $approxsize " ;

$headers .= 'MIME-Version: 1.0' ;
$mailto = "email address"."\r\n";
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;
$headers .= 'Reply-To: $mailfrom' ."\r\n" ;
$headers = "From: $email"; 

mail ($mailto, $subject, $output, $headers);

header( "Location: /success.html" );
?>
 
Soldato
OP
Joined
25 Jan 2007
Posts
4,738
Location
King's Lynn
Is the need for the email of the sender to be placed with the 'on behalf of'... not really, as long as I can still click 'reply' to reply to any emails without needing to fill in the email address I'm fine with that.
 
Back
Top Bottom