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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Mail problem

Status
Not open for further replies.

jefargrafx

Instructor
May 24, 2001
273
US
need more eyes on tis problem than me.

I have a php mail script that take info from a form and emails it to an address. I want the user to be able to hit the reply button and have the email to field populated with what ever the sender put on the form.

Now get this. It works perfect on my vista computer using IE(gmail), Firefox(gmail), and Outlook 2007.

But not on my clients pc under the same situation, (I've verified via remote desktop)

Anit that strange.

here's is a copy of my script.


$emailerror = "/contact/emailerror";
$redirect = "/contact/thanks";
$subject = "Leslie Wells Realty - Request Information";
$emailbody = "You have a new message from $yourname at $email.\r\n".
"<br>".
"<br>".
"Customer Comments: " . stripslashes($comments)."\n".
"<br>".
//"Customer Name: $yourname\n".
//"Customer E-mail: $email\n".
"<br>".
"$title\n".
"<br>".
"$mls\n".
"<br>".
"$lwrnum\n".
"<br>".
"<br>".
"Property Type: $type_property\n".
"<br>".
"Price Range: $price_range\n".
"<br>".
"$price\n".
"<br>".
"$viewingProp\n";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: RequestInformation@lesliewellsrealty.com"."\r\n";
$headers .= "X-Priority: 3\r\n";
$headers .= "Return-Path: ".$email." <".$email.">\r\n";
$headers .= "Reply-to: ".$email." <".$email.">\r\n";

if (mail($recipient,$subject,$emailbody, $headers)) {
header("location: $redirect");
} else {
header("location: $emailerror");
}


yall got any idea why this would be, anything to do with exchange???? doesn't make sense to me.

jef
 
Hi

jef said:
But not on my clients pc under the same situation, (I've verified via remote desktop)
I am too lazy to also verify it on you client's PC via Remote desktop. Could you please share some details about how this not worked ?
[ul]
[li]Nothing happened[/li]
[li]Error message appeared[/li]
[li][tt]mail()[/tt] returned [tt]true[/tt] but no mail was sent[/li]
[li]Mail was sent but not received[/li]
[li]Mail was received but was messed up[/li]
[li]Mail was received but when replying the To address was wrong[/li]
[li]When replying nothing happened[/li]
[li]When replying error message appeared[/li]
[li]When replying the mail was not sent[/li]
[li]When replying the mail was sent but not received[/li]
[li]The reply mail was received but messed up[/li]
[/ul]


Feherke.
 
sure,

when (on my clients pc) you open the email and press the reply button either in outlook or browser based cleint the reply field is populated with

emailname@ <emailname@domain.com>

now on my pc it get

emailname@domain.com <emailname@domain.com>

and it work great!!!

I've had him test it on two different pcs there vista and xp and both fail.

I've tested here with two pc vista 64 and vista 32 both seceed.

what's going on here.

jef
 
Hi
[ul]
[li]What is the value of $email variable ?[/li]
[li]Why specify the same string both as name and as address ? Is enough
Code:
[navy]$headers[/navy] [teal].=[/teal] [green][i]"Reply-to: $email\r\n"[/i][/green][teal];[/teal]
[/li]
[li]Why not enclose the name part in double quotes ?
Code:
[navy]$headers[/navy] [teal].=[/teal] [green][i]"Reply-to: \"$email\" <$email>\r\n"[/i][/green][teal];[/teal]
[/li]
[/ul]


Feherke.
 
the value of email is what ever the sender puts in the email form field, such as myemail@mydomain.com

well I guess I could use the name field for the name, but wanted to make sure that an email address got pushed over.

and I'll try the double quote idea, but did n't think that was required.

stay tuned I'll make these changes

jef
 
unless you are doing some server-side validation, using user generated data in an email header effectively exposes your server as an open relay.

instead of coding by hand like this why not use a prebuilt application like phpmailer?
 
good idea,

but the emai lis validated and got it working.

was missing a header and adding the "" around the name made all the difference.

thanks so much for all your help.

sometime you just need another set of eye.

job done

jef
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top