When using FormMail script we used to have realname and e-mail set, so when somebody use form on the site and type name and e-mail address - we would get this in mailbox:
From: Name <email@example>.
This was practical since we could reply easily to them without cut/paste address. How can we implement this using PHPform?
The $header method can accomodate this.
$headers = 'From: name <email@url.com>' . "\r\n";
The exact syntax for your form may include some variation of quotes or special character excapes. Since I have not used this I can not tell you with 100% confidence that the above syntax works. In any case you can see other examples here: http://www.php.net/mail
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
When using FormMail script we used to have realname and e-mail set, so when somebody use form on the site and type name and e-mail address - we would get this in mailbox:
From: Name <email@example>.
This was practical since we could reply easily to them without cut/paste address. How can we implement this using PHPform?
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
$headers .= 'Cc: boss@example.com' . "\r\n";
mail("webmaster@example.com","Contact Requested","Data:
Name: " . $_POST['field_5'] . "
Company Name: " . $_POST['field_6'] . "
City: " . $_POST['field_7'] . "
State: " . $_POST['field_8'] . "
Zip Code: " . $_POST['field_9'] . "
Phone: " . $_POST['field_10'] . "
Fax: " . $_POST['field_11'] . "
E-mail: " . $_POST['field_12'] . "
Message: " . $_POST['field_14'] . "
",$headers);
include("thank_you.htm");
?>
The $header method can accomodate this.
$headers = 'From: name <email@url.com>' . "\r\n";
The exact syntax for your form may include some variation of quotes or special character excapes. Since I have not used this I can not tell you with 100% confidence that the above syntax works. In any case you can see other examples here:
http://www.php.net/mail