Hi, I am new for the PHP email form. I had been trying to learn how to use the PHP email from scripts over different places in the internet. I was very interesting to learn how to create the PHP custom email form like "contact us", "tell a friend", etc.
One problem, I had problem to understand in PHP email form script as "email($toEmail, $subject, $message, $from)”. I wanted to add $message2 or $body into “email($toEmail, $subject, $message, $from)”. It didn't work with $message2 or $body. What did I miss? I thought it is very simple to add?
Here's 2 email form scripts below...
Original script before adding “$message2”: (it is working fine)
$subject= "Your friend has referred you this link from www.sitename.com";
$subject= "$fromName has referred you this link from www.sitename.com";
$message = "
Your friend $fromName has referred this link to you.
Please visit this link by clicking $ref
$from = "From: $fromEmail\r\n";
mail($toEmail, $subject, $body, $message, $from);
$sent = "your message has been sent";