# PHP email problems

**URL:** <https://forum.kirupa.com/t/php-email-problems/237285>\
**Category:** programming\
**Created:** [August 28, 2007, 10:55pm UTC](https://forum.kirupa.com/t/php-email-problems/237285 "2007-08-28T22:55:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)\
**Post date:** [August 28, 2007, 10:55pm UTC](https://forum.kirupa.com/t/php-email-problems/237285/1 "2007-08-28T22:55:05Z")

</div>

I’m having real issues getting this php script to work properly, and my web hosts aren’t being much help. Everyone I talk to says it should work fine.

The variables are coming in from a flash form.

The issue is as follows:

Instead of the name, for example, John Smith, appearing in the From: field properly in my email application (and others that I have tested) it appears like this:

[John@web10.asio.net](mailto:John@web10.asio.net), [Smith@web10.asio.net](mailto:Smith@web10.asio.net)

[web10.asio.net](http://web10.asio.net) being the localhost.

Is there away around this some how?

Heres the script.

```php

<?php
$to = ' ********* @gmail.com';

$message = $_POST["message"];   
$telephone = $_POST["telephone"];  
$company = $_POST["company"]; 
$name = $_POST["name"]; 

$subject = 'Inquiry';

$msg = "<p><b>Name:</b>" . $name . "</p>" . "<p><b>Company:</b>" . $company . "</p>" . "<p><b>Telephone:</b>" . $telephone . "</p>" . "<p><b>Enquiry:</b>" .$message . "</p>"; 

$headers = "Content-Type: text/html; charset=\"windows-1251\"
";
$headers .= "From: " . $_POST["name"] . "
";
$headers .= "Reply-To: " . $_POST["email"] . "
";
$headers .= "Return-path: " . $_POST["email"]."
"; 
   
mail($to, $subject, $msg, $headers);

?>

```
