• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 517
  • Last Modified:

php mail form bug...

Im writing a mail form with php and it works fine, kinda.  the kinda part is that it dosent always send both emails, the main to me and the auto reply. the auto reply always goes but the one to me is sometimes not sent.  It seems to happen more often when i click the submit button a few times in a row.  Is it posible that the php file is being run by a new process while the first is still running messing things up?  If so does anybody know how to make sure the php file is only accesed by one browser window at a time?

Thanks,
Apolo.
0
apolo63
Asked:
apolo63
  • 2
1 Solution
 
apolo63Author Commented:
I now notice it works perfect every time if i take out the from: field.

mail("email address", "Subject", "$message","From: $Email");

but the reply mail that is not a variable in the from: field works all the time.

mail("email address", "Subject", "$message","From: somemail@somewhere.com");

any ideas?

Later all,
Apolo.
0
 
lexxwernCommented:
try the following:
mail("email address", "Subject", "$message","From: $Email\r\n");




-=-=-=-=--=-=-=-=-=-=-
Get Coders to Work for You:

http://www.RentACoder.com/RentACoder/SmallBiz.asp?txtFromURL=AId_517531

http://www.scriptlance.com/cgi-bin/freelancers/r.cgi?srirangan

-=-=-=-=--=-=-=-=-=-=-
Best Web Hosting deal for You:

http://www.qksrv.net/click-1267313-890216

-=-=-=-=--=-=-=-=-=-=-
  l   e   x   x   w   e   r   n
0
 
kenfcampCommented:
Hello:

correct me if I'm wrong.. I see your setup as:

'email address' = your email address where you want a copy

'subject' = predifined or form set subject message

'$message' = predifinded or form set message to recipient

'$Email' = email address of person filling out the form (recipient)

Following those definations.. this should work for you

<?
$recipient = "$Email";
$subject = "Re: the form you filled out at http://www.yourdomain.com";
$message = "Message to recipient here";
$extra = "From: Who or what this email was sent(john doe)";
mail($recipient,$subject,$message,$extra);

$recipient = "you@yourdomain.com";
$subject = "Re: Form has been filled out";
$message = "$Email has replied filled out your form";
$extra = "From: Your trusty PHP Form Mail";
mail($recipient,$subject,$message,$extra);
?>

This has 2 parts.. the first sends the email to The recipient (the person filling out the form)

The second sends a copy to you

Hope this helps

KC
0
 
apolo63Author Commented:
Cool, seems good with that...

Thanks for the help all...

Later,
Apolo.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now