I got doubt in this code, i am a newbie to PHP,,, it is a simple contact form, $headers = "From: " . $mailform_from . "\n"; // From address $headers .= "Reply-To: " . $mailform_from . "\n"; // Reply-to address PHP: mailform_from is the name for the "from email" in a contact form,,,,, whey they are using 2 times,,,,, and also, what is the meaning of "$headers .=" here another mail(str_replace("RCPT TO:", "", $reciever), str_replace("RCPT TO:", "", $subject), str_replace("RCPT TO:", "", $alertmsg), str_replace("RCPT TO:", "", $headers)); PHP: in the above code whey they used str_replace inside the mail function,, and also why they are checking for "RCPT TO:",,,,,,,
1. $mailfrom_from is used 2 times to indicate it as sender id and also as reply to id. meaning, whenever someone clicks on reply, it will be sent to same email id. By default when not mentioned reply-to, it is automatically sent to sender only, but in case if you wish to receive replies on different email id, this parameter is used. 2. str_replace is used for removing 'RCPT TO:' from various variables.
not really, there must be a purpose behind doing this.. actually 'RCPT TO:' is one of the SMTP command and they are being removed using str_replace. I would suggest you to keep it as it is unless it is giving some problem. Meanwhile you can do more study over 'RCPT TO:' command of SMTP