You've got:
$ttext = "
Hi,
A friend or colleague of yours, ".$name.", whose email address is ".$email." thought you may like to visit our site. ".$name." has used our Tell-a-Friend form to send you this email.
http://www.yoursite.com
";
The problem here is that you've started your quoted string with a doublequote, and so when PHP finds the next doublequote it assumes it's the end of the string.
Read through your code above. The first double quotes signify the start of a string, the first element of the string is a carriage return and then the word Hi and so on until the next doublequote after yours, . This doublequote marks the end of the literal string. The next piece .$name tells PHP to append the value of the variable $name to the literal string. the next piece ." has used..." adds another literal to the string... and so on. If you had <a href ="http://www.yoursite.com"> in the middle of a literal string, it would assume that the doublequotes after href= marked the end of a literal string, and it wouldn't have a notion what to do with http://www.yoursite.com as that's not a PHP command.
To get around this, you need to escape those doublequotes in the href. You do this by putting a backslash in front of them. This tells PHP that the double quote doesn't end the string literal, but is to be part of it.
$ttext = "
Hi,
A friend or colleague of yours, ".$name.", whose email address is ".$email." thought you may like to visit our site. ".$name." has used our Tell-a-Friend form to send you this email.
<a href=\"http://www.yoursite.com\">Your Site!</a>
";
Or you could use single quotes in the href instead, since you're using doublequotes for the string literal:
$ttext = "
Hi,
A friend or colleague of yours, ".$name.", whose email address is ".$email." thought you may like to visit our site. ".$name." has used our Tell-a-Friend form to send you this email.
<a href='http://www.yoursite.com'>Your Site!</a>
";