Auto email responder

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
Greg19
Forum Newbie
Posts: 23
Joined: Sun Dec 07, 2008 12:47 pm

Auto email responder

Post by Greg19 »

Hello everyone I'm trying to send an email through php after a user has singed up. I'm getting this error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/content/J/a/p/JapII/html/reftek/register.php on line 39

this is line 39:

Code: Select all

$mail_body = "Thank you for registering with tech" "Username:". $username . "Password:" . $password .
And the entire thing:

Code: Select all

 
$username = ($_POST['company']);
$password = ($_POST['password']);
 
$Name = "Tech Support Team"; //senders name
$email = "support@tech.com"; //senders e-mail adress
$recipient = ($_POST['email']); //recipient
$recipient2 = "tech@gmail.com";
$mail_body = "Thank you for registering with tech" "Username:". $username . "Password:" . $password .
             "You may use your newly setup account to access documentation, firmware, software, and other items for your products at support.tech.com" 
             "-Support Team";//mail body
$subject = "Your Username and Password for support services"; //subject
$header = "From:". $Name . " <" . $email . ">\r\n"; //optional headerfields
 
mail($recipient, $subject, $mail_body, $header); //mail command :)
mail($recipient2, $subject, $mail_body, $header);
 
echo "Mail Sent";
echo "<br/>";
echo"Registration was successful.";
cristiano
Forum Newbie
Posts: 18
Joined: Tue Jul 01, 2008 1:44 am

Re: Auto email responder

Post by cristiano »

Code: Select all

 
$mail_body = "Thank you for registering with tech" "Username:". $username . "Password:" . $password .
 
Look at this line after tech" "Username

That's what is said in the error. Remove the extra double quotes. That should solve your problem.
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Auto email responder

Post by jaoudestudios »

Which is line 39???

I assume it is this....
# $mail_body = "Thank you for registering with tech" "Username:". $username . "Password:" . $password .
"You may use your newly setup account to access documentation, firmware, software, and other items for your products at support.tech.com"
"-Support Team";//mail body
You have double quote then double quote again!
Post Reply