FORM: Name as sender instead of e-mail.

I have a very basic form that uses PhpMail to send it’s content but is there some way to change the “sender name” of the form from an e-mail adress to a name.

Example:
Instead of “from: form.ello@whatever.org” it says “From: Ello Recruitment” or whatever.

Here’s the code i’m currently using:

HTML:

<form name="10_percent" action="http://www.whatever.org/recruit.php" method="post" style="text-align:center;">
<label for="description"><p>Description</p></label>
<textarea name="description" id="description" rows="4" cols="50"></textarea>
<input type="submit" id="submit" name="submit" value="Send" style="width:88px; height:24px;"/>
</form>

PHP:

<?php
if(isset($_POST['submit'])) {
$to = "xxx@whatever.org";
$subject = "Recruitment";
$epost_field = $_POST['description'];

$headers = "Content-type: text/html; charset=utf-8rn";
$headers = 'From: Ello Recruitment' . "rn" .
'Reply-To: xxx@whatever.org' . "rn" .
'X-Mailer: PHP/' . phpversion();


$body = "$description_fieldn";


echo "<meta http-equiv="refresh" content="0;URL=http://www.whatever.org">";
mail($to, $subject, $body, $headers);
} else {
echo "not working";
}
?>


Source: forms

Leave a Reply