Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 05-08-2008, 04:43 PM   #1
Member (7 bit)
 
Join Date: Aug 2005
Location: New York
Posts: 95
PHP Contact Form - Setting Return Path for Emails

I have a few PHP contact forms on my website. I use the following (or similar) to set up the code for emailing the info enterd into the form:

Code:
$to = "$myemail";
$subject = "Subject";
$body = "Body";
$headers = "From: $theiremail\r\n";
$headers .= "Return-Path: $myemail\r\n";
mail($to, $subject, $body, $headers);
However, the Return-Path setting doesn't seem to work. When I look at the properties of the resulting message, it shows my username@someserver.com. I don't like this as it gives away my username. I notice that my shopping cart, photo gallery, php list, etc. show the email address within my domain where the message is being sent from for the Return Path, but I haven't been able to narrow down the code they use to send emails.

I know a decent amount of PHP, but I'm certainly no expert. Does anyone know what I'm doing wrong here? I'd really appreciate any help in getting this to work the way I want.

Thanks,
Jill
jillsy is offline   Reply With Quote
Old 05-08-2008, 08:26 PM   #2
Chop Chop
 
catacon's Avatar
 
Join Date: Jan 2005
Location: St. Louis, MO
Posts: 1,035
Send a message via AIM to catacon Send a message via Yahoo to catacon
Under Windows, the From header sets the return path. It seems to me that the return path should be their email not yours. Try removing the Return Path header and see what happens.

http://us3.php.net/function.mail
catacon is offline   Reply With Quote
Old 05-08-2008, 11:21 PM   #3
Member (7 bit)
 
Join Date: Aug 2005
Location: New York
Posts: 95
Thanks, catacon. I tried it, but it didn't work.

I've used the Reply-To header successfully before. When I hosted with Yahoo, the server wouldn't allow an email to be sent from an email address outside your domain. So to be able to simply reply to a contact form submission, I had to set the Reply-To to the person's email address since I could not set the From header to it. I'm using different hosts now.

However, for some reason the Return-Path header is being ignored, at least in the context in which I'm using it in my contact forms. I'm having the problem on two different hosts (both Linux). I know it's not simply the servers since the photo gallery, etc. are somehow able to set the return path correctly. I'll have to keep digging and see what I can find.

Thanks,
Jill
jillsy is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a contact form patru Web Design / Development 2 07-17-2007 03:02 PM
php email form michael0224 Web Design / Development 2 07-25-2006 10:38 AM
Computer Acronyms Floppyman Computer Hardware 156 06-18-2006 06:25 AM
php form doesnt work darkside Web Design / Development 2 08-26-2005 03:15 PM
Setting up Apache Server with PHP fatboyjim Internet, Web Applications, & The Cloud 4 11-23-2002 05:32 PM


All times are GMT -5. The time now is 07:36 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2