Access, HTML email, memo fields and new lines/carriage returns
Posted on 2012-03-15
I've built a function in our access database that generates an HTML email and populates some of the body of the email from a few different records in the database. (So I've essentially wrapped HTML within access code by setting .HTMLBody = "htmlCodeHere").
I used to send this email out using SendObject format TXT, now writing this to create a pretty HTML email.
It works great, with one exception: I have a memo field in the database where users enter data: some times sentences, some time paragraphs, always with several carriage returns/new lines. The problem: HTML doesn't interpret these as enters/new lines when formulating the email.
Example, if the memo field has the following data:
* line one here
* line two here
* line three here
It will output in the email as:
* line one here * line two here * line three here.
Obviously the HTML tag for new line is <br>, but how do I get the database or HTML to interpret the new lines in the memo field into a new line in the HTML code?