Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendmail

Status
Not open for further replies.

brogan

Technical User
Oct 7, 2003
44
GB
Hi, I have the following email form on contact.htm

<FORM method=post action="sendmail.php">
Email: <INPUT name="email" type="text"><br>
Message:<br>
<TEXTAREA name="message">
</textarea><br>
<input type=submit>
</FORM>

The details from this are sent to sendmail.php, below

<?
mail( "root@mydomain.com", "Feedback Form Results",
"$message", "From: $email", "mail.mydomain.com" );
header( "Location: );
?>

The email reaches the email box and the subject "Feedback Form Results" appears, however "unknown" is displayed in the "from" box and there is nothing in the message part of the email.

Any help is appreciated

Mark
 
If the message field is blank, I'm wondering is you have register_globals turned off. Try $_POST['message'] instead.

Specifically what mail server are you using? It can make a difference as to how to get the "From" header right.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
It's using the mail server provided by my host streamline.net

Thanks

Mark
 
That doesn't really tell me enough. And it is important as to how to set your "From" header correctly.

Can they tell you? Is it sendmail, qmail, postfix, other?


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
It looks to me like the example code they've provided is pretty explicit. It looks like you're missing the last parameter to the function call.

Just pay attention to my earlier advice about register_globals and using $_POST. See and section 1.1 if faq434-2999


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top