Sending emails and html

Sending emails and html

Postby driessen » Fri Feb 27, 2009 10:49 am

Hello,

I want to send emails using html to be able to add a heading to my messages.

To do this, I use the function : oMail:HtmlBody.

But there is also the function : oMail:Body.

In fact, the first function is doing the job, except for the layout of the text I want to add. All CRLF of CHR(13) are denied which results into the all the text being grouped into one block.

What can I do to solve this problem ?

My code for instance looks like this :
Code: Select all  Expand view
LOCAL EmText := "" // Variable to put my text in.
.....
oMail:HTMLBody := "<html><body><p><img border=" + CHR(34) + "0" + CHR(34) + "src=" + CHR(34) + "http://www.ma-consult.be/image.jpg" + CHR(34) + " width=" + CHR(34) + "305" + CHR(34) + " height=" + CHR(34) + "67" + CHR(34) + "></p><p>" + ALLTRIM(FmText) + "</p></body></html>"

The image-file is shown in my email, the text (FmText) follows immediately, but unformated (all text behind each other).

I hope someone can help me, maybe by adding some hmtl-code ?

Thanks a lot in advance.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Sending emails and html

Postby Enrico Maria Giordano » Fri Feb 27, 2009 11:57 am

You have to use <p> or <br> intead of CRLF.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8381
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests