Page 1 of 1

eMail with html

Posted: Fri Sep 22, 2023 11:27 pm
by D.Fernandez
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

Re: eMail with html

Posted: Sun Sep 24, 2023 9:38 pm
by Jimmy
hi,

i have read "somewhere"
There is an undocumented feature of MAPISendMail for including an HTML body:

Code: Select all | Expand

    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: Select all | Expand

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

Re: eMail with html

Posted: Sun Sep 24, 2023 10:53 pm
by rubenfernandez01
Thanks very much Jimmy.

Saludos
Ruben Dario Fernandez

Enviado desde mi 21081111RG mediante Tapatalk