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.

Instead of “from:” it says “From: Ello Recruitment” or whatever.

Here’s the code i’m currently using:


<form name="10_percent" action="" 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;"/>


if(isset($_POST['submit'])) {
$to = "";
$subject = "Recruitment";
$epost_field = $_POST['description'];

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

$body = "$description_fieldn";

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

Source: forms

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.