Forum Moderators: coopster
here's my code
<?php
if (isset($HTTP_POST_VARS['submit'])) { $subject=($HTTP_POST_VARS['title']);
$body=($HTTP_POST_VARS['message']);
$from=($HTTP_POST_VARS['sender']);
&sender_email=($HTTP_POST_VARS['email']);
mail('me@mydomain.com', $subject, $body, $from, &sender_email);
echo ' <h3>Your email has been sent</h3>
<p>Thanks '. ($HTTP_POST_VARS['name']) .'</p>
';
}
else{
?>
<form id="email" method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
<fieldset>
<label for="sender">Your name</label><input id="sender" name="sender"><br>
<label for="email">Your email</label><input id="email" name="email"><br>
<label for="title">Subject</label><input id="title" name="title"><br>
<label for="message">Message</label><textarea id="message" name="message" cols="1" rows="1"></textarea><br>
<input type="submit" id="submit" name="submit" value="send">
</fieldset>
</form>
please help me out.
The additional_parameters parameter can be used to pass an additional parameter to the program configured to use when sending mail using the sendmail_path configuration setting. For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option. You may need to add the user that your web server runs as to your sendmail configuration to prevent a 'X-Warning' header from being added to the message when you set the envelope sender using this method. Example 3. Sending mail with extra headers and setting an additional command line parameter.
<?php
mail("nobody@example.com", "the subject", $message,
"From: webmaster@{$_SERVER['SERVER_NAME']}", "-fwebmaster@{$_SERVER['SERVER_NAME']}");
?>
<?php
if (isset($HTTP_POST_VARS['submit'])) { $subject=($HTTP_POST_VARS['title']);
$message=($HTTP_POST_VARS['message']).'\n '.($HTTP_POST_VARS['sender']).'\n '.($HTTP_POST_VARS['email']);
$headers .= '"From: '.($HTTP_POST_VARS['sender']).' <'.($HTTP_POST_VARS['email']). '>\r\n"';
mail('myemailaddress@server.com, $subject, $message, $headers);
echo ' <h3>Your email has been sent</h3>
<p>Thanks '. ($HTTP_POST_VARS['sender']) .'</p>
';
}
else{
?>
i get the email with the body conatining the message along with sender's name and email address but in the from box in my mailbox it says it from Nobody!