I have a page that is called from loads of different pages that basically sends emails. It has text boxes for Subject, From Address etc. and a textbox like the one I am typing in now (on this site) which allows users to format a html message.

I need to develop the functionality by providing email templates for the message.

So, the template text (which will be stored and retrieved from a database) might contain:

Dear .......

Thanks for attending the meeting.

Kind regards
.......


Where the ...... are, I would want to fill in the name of the person who is going to receive the email and the name of the person sending it.

So, I'm on the page - I've retrieved the text for the message from the database - I have SendersName and ReceiversName sitting there in variables - how do I get them in the text in the right place?

I was thinking I could make the template text look like this:-

Dear [ReceiversName]

Thanks for attending the meeting.

Kind regards
[SendersName]


and then, on the page, just Replace the various 'tags'. Is this a good idea?

Thanks for any suggestions.