FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour eMail with html
Posts: 555
Joined: Wed Jul 31, 2013 01:14 PM
eMail with html
Posted: Fri Sep 22, 2023 11:27 PM

Hello friends.

I'm trying to send an eMail with html format, but I can't. Any help, please.

cText := <!DOCTYPE html>

<html lang="en" data-bs-theme="dark">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>Resúmen de cuenta</title>

</head>

<body>

</body>

</html>

DEFINE MAIL oMail ;

SUBJECT "Mejoras para Ud." ;

TEXT cTEXT ;

TO cCorreo ;

FROM USER

ACTIVATE MAIL oMail

Muchas gracias

Saludos

Ruben Dario Fernandez

Dario Fernandez

FWH 2501, Harbour, MVS2022 Community, MySql & MariaDB, Dbf/Cdx VSCode.

Maldonado - Uruguay
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: eMail with html
Posted: Sun Sep 24, 2023 09:38 PM
hi,

i have read "somewhere"
There is an undocumented feature of MAPISendMail for including an HTML body:
Code (fw): Select all Collapse
    set lpszNoteText to nil (or a pointer to an empty string)
    add an HTML attachment
MAPI will use the html attachment as the body of the e-mail (and not include the attachment).
---
Officially, Simple MAPI does not support HTML.

If you however set the message body to NULL (not just an empty string), and
the very first attachment is an HTML file, the outgoing message will be HTML
populated from the atttachment data. I don't know whether this is a bug or a
feature.
Code (fw): Select all Collapse
m_pMessage->lpszNoteText = NULL;
m_pMessage->lpszMessageType = "IPM.Note";
m_pMessage->lpszConversationID = NULL; // <-- set to null
---
as TEXT point to lpszNoteText try NIL or NULL
DEFINE MAIL [<oMail>] ;
[ SUBJECT <cSubject> ] ;
[ TEXT <cText> ] ;
[ TYPE <cType> ] ;
and add a HTML as Attachment
greeting,

Jimmy
Posts: 48
Joined: Sun Sep 20, 2015 01:41 AM
Re: eMail with html
Posted: Sun Sep 24, 2023 10:53 PM

Thanks very much Jimmy.

Saludos

Ruben Dario Fernandez

Enviado desde mi 21081111RG mediante Tapatalk

Continue the discussion