email send error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bruceg
Forum Contributor
Posts: 174
Joined: Wed Mar 16, 2005 11:07 am
Location: Morrisville, NC
Contact:

email send error

Post by bruceg »

I am getting an error with this email script I got from a PHP book, that I wanted to try out. I am not sure where the error is coming from.

Code: Select all

<?php
//who is the email going to?
$to="emailaddress@gmail.com";
//what is the message?
$message = "This is my first email message sent from PHP.\r\n"
                   ."This is a second line of text \r\n";
//who else do we want to send the message to?
$more_headers = "Cc:emailaddress@mindspring.com\r\n";
//send the email
$result=mail(
$to,
"my first email sent from PHP",
$message
$more_headers
);
?>
the error is


Parse error: syntax error, unexpected T_VARIABLE in email_send.php on line 6
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

missing a comma on line 14.
Post Reply