What to do?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TRUCKIN
Forum Newbie
Posts: 4
Joined: Sun Aug 29, 2004 7:24 pm

What to do?

Post by TRUCKIN »

Hello,


I'm working on a form for my site and its not sending me an email...



here is the link to the php code http://www.i-drum.com/feedback.txt


here is the link to the form http://www.i-drum.com/emailform.html


This is what im running

PHP 4.3.8

Apache 1.3.31

MySQL 4.0.20

Zend Optimizer 2.5.3

phpMyAdmin 2.6.0-rc1

Perl 5.8.4


if that matters any :?


thanks :D
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the code, so no one has to go get it:

Code: Select all

<?php

// Configuration Settings
$SendFrom =    "Form Feedback <truckinunderground@yahoo.com>";
$SendTo =      "truckinunderground@yahoo.com";
$SubjectLine = "Feedback Submission";
$ThanksURL =   "thanks.html";  //confirmation page
$Divider =     "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";

// Build Message Body from Web Form Input
$MsgBody = @gethostbyaddr($REMOTE_ADDR) . "\n$Divider\n";
foreach ($_POST as $Field=>$Value)
   $MsgBody .= "$Field: $Value\n";
$MsgBody .= $Divider . "\n" . $HTTP_USER_AGENT . "\n";
$MsgBody = htmlspecialchars($MsgBody);  //make content safe

// Send E-Mail and Direct Browser to Confirmation Page
mail($SendTo, $SubjectLine, $MsgBody, "From: " . $SendFrom);
header("Location: $ThanksURL");

?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you may need to add some more headers.. yahoo has a few things it requires, iirc.. Reply-To, Return-Path, there may be a few more..
Post Reply