MAPI Outlook HTML TEXT

Post Reply
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

MAPI Outlook HTML TEXT

Post by MarcoBoschi »

Hi,
using this instruction from my fivewin program I obtain a perfect message If I use Thunderbird or David Infocenter
If I use Outlook no
I don't see the formatted text in the body but I see it as if it were normal text

DEFINE MAIL oMail ;
SUBJECT cSubject ;
TEXT cBodyHtml ;
FROM USER

any suggestions other than using another email program? :D

by by marco
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: MAPI Outlook HTML TEXT

Post by karinha »

Show TEXT cBodyHtml ???

Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: MAPI Outlook HTML TEXT

Post by MarcoBoschi »

Obviously I cut off some part of text for sensitive data

Code: Select all | Expand

<!DOCTYPE html>
<html>
  <head><META http-equiv=Content-Type content="text/html; charset=utf-8">

    
  </head>
  <body style="word-wrap:break-word" vlink="#954F72" link="#0563C1"
    lang="IT">
    Buongiorno,
    <div class="moz-forward-container">
      <div class="WordSection1">
        <p class="MsoPlainText">si invia in allegato la situazione
          contabile delle partite in essere alla data odierna.
          </p>
        <p class="MsoNormal"
          style="margin-top:2.35pt;text-autospace:none"><span
            style="mso-fareast-language:IT">Vi preghiamo di eseguire il
            pagamento delle fatture scadute
          </span><span style="color:black">sul seguente appoggio
            bancario</span>:<span
            style="color:black;mso-fareast-language:IT"></span></p>
        <p class="MsoNormal" style="text-align:justify"><span
            style="mso-fareast-language:IT">Se avete già provveduto a
            quanto succitato, Vi preghiamo di ritenere nulla la presente
            e di darcene comunicazione scritta e/o telefonica.</span></p>
        <p class="MsoPlainText">Restiamo a disposizione per qualsiasi
          chiarimento.</p>
        <p class="MsoPlainText">Distinti saluti</p>
        <p class="MsoNormal"> </p>
      </div>
    </div>
  </body>
</html>
 
Marco Boschi
info@marcoboschi.it
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: MAPI Outlook HTML TEXT

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
paquitohm
Posts: 284
Joined: Fri Jan 14, 2022 8:37 am

Re: MAPI Outlook HTML TEXT

Post by paquitohm »

Is not possible
Use OLE instead through outlook. A little problem: It requires configuration in outlook for sending 3rd parties software
User avatar
karinha
Posts: 7885
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil
Contact:

Re: MAPI Outlook HTML TEXT

Post by karinha »

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
cmsoft
Posts: 1293
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: MAPI Outlook HTML TEXT

Post by cmsoft »

Marco:
En el html no estas incluyendo el estilo css que usas.
Tal vez te falte eso para darle el formato deseado.
Incluye el estilo, algo asi como esto:

Code: Select all | Expand

<style type="text/css">
    .moz-forward-container {
      padding-top: 10px;
      background-color: #ccc;
    }
    .WordSection1 {
      margin-left: 20px;
      padding-top: 5px;      
    }
    .MsoNormal {
      text-align: center;
      color: red;
    }
    .MsoPlainText {
      font-family: Roboto;
      color: white;
      background-color: #336699;
    }
  </style>
Para ver si te respeta el estilo esperado
Obviamente el estilo se lo tienes que dar vos según tus preferencias
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: MAPI Outlook HTML TEXT

Post by MarcoBoschi »

many thanks!
Marco Boschi
info@marcoboschi.it
Horizon
Posts: 1323
Joined: Fri May 23, 2008 1:33 pm

Re: MAPI Outlook HTML TEXT

Post by Horizon »

Hi,

If there is more than one account in Outlook, how can I select account that should be send from?
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
User avatar
MarcoBoschi
Posts: 1070
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy
Contact:

Re: MAPI Outlook HTML TEXT

Post by MarcoBoschi »

I cannot test it but maybe

oMailItem:to := cRecipient
oMailItem:from := cFrom

you should try
Marco Boschi
info@marcoboschi.it
Horizon
Posts: 1323
Joined: Fri May 23, 2008 1:33 pm

Re: MAPI Outlook HTML TEXT

Post by Horizon »

MarcoBoschi wrote:I cannot test it but maybe

oMailItem:to := cRecipient
oMailItem:from := cFrom

you should try
Thank you. But I have tried and get an errormessage.

Code: Select all | Expand

Error description: (DOS Error -2147352570) WINOLE/1008  No exported variable: FROM
   Args:
     [   1] = C   hakan@objekt.com.tr

Stack Calls
===========
   Called from: ..\contrib\hbwin\oleauto.prg => TOLEAUTO:_FROM( 0 )
I have found this event but I could not know how to implement.
https://learn.microsoft.com/en-us/offic ... ingaccount

Code: Select all | Expand

Sub SendUsingAccount() 
 
 Dim oAccount As Outlook.account 
 
 For Each oAccount In Application.Session.Accounts 
 
 If oAccount.AccountType = olPop3 Then 
 
 Dim oMail As Outlook.MailItem 
 
 Set oMail = Application.CreateItem(olMailItem) 
 
     oMail.Subject = "Sent using POP3 Account" 
 
     oMail.Recipients.Add ("someone@example.com") 
 
     oMail.Recipients.ResolveAll 
 
 Set oMail.SendUsingAccount = oAccount 
 
     oMail.Send 
 
 End If 
 
 Next
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Post Reply