Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

send email as HTML - HB_SendMail()

54 views
Skip to first unread message

Otto Haldi

unread,
Dec 31, 2010, 8:20:34 AM12/31/10
to
Hello,

I found the following sample, how to send a HTML email.

>create the html file with .htm or .html extension
>then pass the .html/.htm file name in cbody parameter
>HB_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, "FILE.html",
>cSubject, aFiles, cUser, cPass, cPopServer, nPriority, lRead, lTrace,
>lPopAuth, lNoAuth, nTimeOut, cReplyTo )

In my case this do not work. The email show me only "file.html"
I also add the content of the file in cBody. Work but HTML tags are not interpreted.
I see all tags!
As attachment (aFiles) work well.
Did I miss something?
Thanks in advance for any help and Happy New Year to all.
Regards
Otto


Man-wai Chang

unread,
Dec 31, 2010, 10:52:29 AM12/31/10
to
> I also add the content of the file in cBody. Work but HTML tags are not interpreted.
> I see all tags!
> As attachment (aFiles) work well.

Look at a typical HTML message, then use all headers accordingly.

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (x86_64 Ubuntu 9.10) Linux 2.6.36.2
^ ^ 23:46:01 up 14 days 7:02 1 user load average: 1.00 1.04 1.01
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa

Otto Haldi

unread,
Jan 2, 2011, 8:17:20 AM1/2/11
to
On Fri, 31 Dec 2010 23:52:29 +0800, Man-wai Chang <toylet...@gmail.com> wrote:

Hello

>> I also add the content of the file in cBody. Work but HTML tags are not interpreted.
>> I see all tags!
>> As attachment (aFiles) work well.
>
>Look at a typical HTML message, then use all headers accordingly.
>

I did many test to add headers on the top of the HTML files!
Like:
cHandle := Fcreate("TestHtml.htm")
Fwrite(cHandle,"MIME-Version: 1.0" + CRLF )
Fwrite(cHandle,"Content-type: text/html; charset=iso-8859-1" + CRLF )
...

Then I read the file before I send it:
hFile := Fopen( "KalgaFibuInfo.htm" )
lFile := Fseek(hFile,0,2)
Fseek(hFile,0)
mBody := FreadStr(hFile,lFile)
Fclose(hFile)

no success. I get as email the file with the tags!


If I send the file as body like :
>HB_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, "TestHtml.htm", .....
>
Then I get as email "TestHtml,htm" and not the file content!

Regards
Otto


Man-wai Chang

unread,
Jan 3, 2011, 8:54:02 AM1/3/11
to
> I did many test to add headers on the top of the HTML files!
> Like:

Use Thunderbird, compose a basic HTML message, then send it to yourself.
Receive the message
Open the received message, View Message Source

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (x86_64 Ubuntu 9.10) Linux 2.6.36.2

^ ^ 21:46:01 up 2 days 3:51 1 user load average: 1.02 1.05 1.04

Man-wai Chang

unread,
Jan 3, 2011, 8:55:10 AM1/3/11
to
On 03/01/2011 21:54, Man-wai Chang wrote:
>> I did many test to add headers on the top of the HTML files!
>> Like:
>
> Use Thunderbird, compose a basic HTML message, then send it to yourself.
> Receive the message
> Open the received message, View Message Source
>

Remember to use a hex editor to look at the end of each line and white
spaces.

cul...@gmail.com

unread,
Jan 3, 2011, 4:40:55 PM1/3/11
to
Hi

for html mail, you need to pass the full filename with path
becouse the html file must be readable to be sent as html email

Regards
Luiz

Otto Haldi

unread,
Jan 4, 2011, 6:28:09 AM1/4/11
to
On Mon, 3 Jan 2011 13:40:55 -0800 (PST), "cul...@gmail.com" <cul...@gmail.com> wrote:


Hello Luiz,

>for html mail, you need to pass the full filename with path
>becouse the html file must be readable to be sent as html email
>

Thanks for your help. Yes... That was the solution!
Happy New Year
Otto

0 new messages