Page 1 of 1

Auto email responder

Posted: Mon Dec 29, 2008 11:10 am
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.";

Re: Auto email responder

Posted: Mon Dec 29, 2008 11:23 am
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.

Re: Auto email responder

Posted: Mon Dec 29, 2008 11:24 am
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!