Page 1 of 1
MAPI Outlook HTML TEXT
Posted: Mon Feb 26, 2024 4:43 pm
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?
by by marco
Re: MAPI Outlook HTML TEXT
Posted: Mon Feb 26, 2024 5:28 pm
by karinha
Show TEXT cBodyHtml ???
Gracias, thanks.
Regards, saludos.
Re: MAPI Outlook HTML TEXT
Posted: Mon Feb 26, 2024 5:39 pm
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>
Re: MAPI Outlook HTML TEXT
Posted: Mon Feb 26, 2024 5:57 pm
by karinha
Re: MAPI Outlook HTML TEXT
Posted: Mon Feb 26, 2024 6:48 pm
by paquitohm
Is not possible
Use OLE instead through outlook. A little problem: It requires configuration in outlook for sending 3rd parties software
Re: MAPI Outlook HTML TEXT
Posted: Mon Feb 26, 2024 8:15 pm
by karinha
Re: MAPI Outlook HTML TEXT
Posted: Mon Feb 26, 2024 10:08 pm
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
Re: MAPI Outlook HTML TEXT
Posted: Tue Feb 27, 2024 8:21 am
by MarcoBoschi
many thanks!
Re: MAPI Outlook HTML TEXT
Posted: Wed Feb 28, 2024 12:49 pm
by Horizon
Hi,
If there is more than one account in Outlook, how can I select account that should be send from?
Re: MAPI Outlook HTML TEXT
Posted: Wed Feb 28, 2024 1:32 pm
by MarcoBoschi
I cannot test it but maybe
oMailItem:to := cRecipient
oMailItem:from := cFrom
you should try
Re: MAPI Outlook HTML TEXT
Posted: Wed Feb 28, 2024 1:50 pm
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