Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-14-2005, 07:46 PM
WebProWorld Pro
 

Join Date: Aug 2004
Location: Maryland
Posts: 219
webmasterjunkie RepRank 0
Default Reply From PHP Form

I have this code below on a contact form on a website. The form uses a POST method and PHP_SELF on submit. The code works fine, but on receiving the form results, I can't reply to the email address. The email address shows up in the sent email, but I get a delivery error when I send a reply.

If anyone has any ideas on why this might be happening, please let me know.

************************************************

<?
$address = getenv("REMOTE_ADDR");
$email = "to@mymail.com";
if (isset($_POST['complete'])) {
$headers = "From: ($_POST[email_address])";
$from_first = ($_POST['first_name']);
$from_last = ($_POST['last_name']);
$body = stripslashes($_POST['comments']);
$body .= "
Thanks,
$from_first $from_last

This information was received from a form online. The user at IP address $address has given the recipient of this form permission to contact them.";
mail("$email", stripslashes($_POST['subject']), $body, $headers);
echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php\">";
exit;
}
$title = "Contact Jim &amp; Amy Donley";
$description = "Do you have a question for us? If so, then just fill out this form and one of us will contact you soon.";
$keywords = "";
require ("images/navigation.php");
require ("events.php");
?>
Reply With Quote
  #2 (permalink)  
Old 04-22-2005, 05:34 PM
m4K's Avatar
m4K m4K is offline
WebProWorld Pro
 

Join Date: Dec 2003
Location: Scarborough, United Kingdom
Posts: 122
m4K RepRank -1
Default

Try this instead, easy to adapt:

$subject = "Website Error";
$headers = "From: " . $FromEmail . "\r\n";
$headers .= "Reply-To: " . $FromEmail . "\r\n";
$headers .= "Return-Path: " . $FromEmail . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = "<message here>";
if ( mail($to,$subject,$message,$headers) ) {

} else {

}

If you need a hand adding it, just let me know.

- Mark
__________________
Make EASY money right now! eMeeting Dating Software Affiliate ProgramEarn 20% per sale! - http://www.datingscripts.co.uk/datin...ite-affiliate/
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0