?
Solved

php mail form bug...

Posted on 2003-03-08
4
Medium Priority
?
493 Views
Last Modified: 2012-05-04
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
Comment
Question by:apolo63
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:apolo63
ID: 8095232
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
 
LVL 12

Expert Comment

by:lexxwern
ID: 8096621
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
 
LVL 14

Accepted Solution

by:
kenfcamp earned 500 total points
ID: 8096640
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
 

Author Comment

by:apolo63
ID: 8100673
Cool, seems good with that...

Thanks for the help all...

Later,
Apolo.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question