MAPI Outlook HTML TEXT

MAPI Outlook HTML TEXT

Postby MarcoBoschi » Mon Feb 26, 2024 4:43 pm

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
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: MAPI Outlook HTML TEXT

Postby karinha » Mon Feb 26, 2024 5:28 pm

Show TEXT cBodyHtml ???

Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7832
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: MAPI Outlook HTML TEXT

Postby MarcoBoschi » Mon Feb 26, 2024 5:39 pm

Obviously I cut off some part of text for sensitive data
Code: Select all  Expand view  RUN
<!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>
 
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: MAPI Outlook HTML TEXT

Postby karinha » Mon Feb 26, 2024 5:57 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7832
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: MAPI Outlook HTML TEXT

Postby paquitohm » Mon Feb 26, 2024 6:48 pm

Is not possible
Use OLE instead through outlook. A little problem: It requires configuration in outlook for sending 3rd parties software
paquitohm
 
Posts: 266
Joined: Fri Jan 14, 2022 8:37 am

Re: MAPI Outlook HTML TEXT

Postby karinha » Mon Feb 26, 2024 8:15 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7832
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: MAPI Outlook HTML TEXT

Postby cmsoft » Mon Feb 26, 2024 10:08 pm

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 view  RUN
<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
cmsoft
 
Posts: 1291
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: MAPI Outlook HTML TEXT

Postby MarcoBoschi » Tue Feb 27, 2024 8:21 am

many thanks!
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: MAPI Outlook HTML TEXT

Postby Horizon » Wed Feb 28, 2024 12:49 pm

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
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: MAPI Outlook HTML TEXT

Postby MarcoBoschi » Wed Feb 28, 2024 1:32 pm

I cannot test it but maybe

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

you should try
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: MAPI Outlook HTML TEXT

Postby Horizon » Wed Feb 28, 2024 1:50 pm

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 view  RUN
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/office/vba/api/outlook.mailitem.sendusingaccount
Code: Select all  Expand view  RUN
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
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 45 guests