Swift Mailer Question

I think I’m getting closer to make this work now. But I have on question that I need help with.

I have a html code with tables and stuff and in the middle of the text part, I have a URL linking to a unique page for every person in my db.
So when I get to this part I need to break out of the code and include the php code and then continue with my html, but I just don’t know how to do this. Can someone help out?

What I have now is something like this:

$htmldocument1 = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>WEBMAIL TEST</title>...

Then I need the code to be added:

$htmldocument2 = $row_rs_table['code']; 

Then the html will continue until the end:

$htmldocument3 = '"CLICK HERE</a></p>
          <p align="left">The link is...

And after all this I need to get all these three parts together into one. Or is this the wrong way?

$htmldocument = $htmldocument1.$htmldocument2.$htmldocument3;

Maybe it’s just something wrong in my code? Did I miss a sign somewhere?
When I send the email, everything after the link is underlined and looks like a link.

Nobody?

it’s not clear to me what you are trying to do.

Well, I’m trying to include a html page in a swift mail e-mail.
But when I come to the part where I want to include the code in the middle it all gets wrong. It won’t handle my code as one page.

Did you add a </a> to close the link?

Well, it seems like there was something wrong with my code just around the link. Not sure if it was the closing tag or something else, but I think it is working now. Did some test yesterday and it was actually working after a while. Now I just need to setup some small things to loop this thing and change the to-field inside every loop.