Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Force outlook to show text as text, not RTF/HTML
Message
De
11/08/2005 09:09:24
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
11/08/2005 05:41:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01039793
Message ID:
01040184
Vues:
29
This works for me on the receiving side:
USE employee
Set Textmerge to memvar m.lcMessage noshow
Set textmerge on
\\<HTML><BODY>&ltPRE&gt
scan
\<<First_name>> | <<Last_Name>> | <<Birth_date>>
EndScan
\&lt/PRE&gt</BODY></HTML>
Set Textmerge to
Set Textmerge off

#include outlook.h
Local oOL as Outlook.Application, oMailItem as Outlook.MailItem
oOL = CreateObject('Outlook.Application')
oMailItem = oOL.CreateItem(olMailItem)
oMailItem.To = "somebody@somewhere.com"
oMailItem.Subject = "Formatted text test"
oMailItem.HTMLBody = m.lcMessage
oMailItem.Send()
I said extra spaces because w/o them sending messages here is problematic.
Cetin

>Cetin,
>
>I tried it, and everything lines up nicely, but ...
>
>When the message arrives, even though Outlook nows it's HTML, it shows it with tags and all.
>
>What should I do? BTW, why the extra spaces in pre /pre?
>
>
>>Peter,
>>Why don't you simply turn it to an HTML message. You could then add a PRE tag. ie:
>>
>>cMyMessage = "My plain text monospaced message ...."
>>cMyMessage = TextMerge('<HTML><BODY>< PRE ><<m.cMyMessage>>< /PRE ></BODY></HTML>')
>>
>>PS: Intentionally placed spaces for < PRE > inside to be able to send.
>>Cetin
>>
>>>Sergey,
>>>
>>>Yes, that had occured to me as well - so how does one force the receiving Outlook to view a particular message with a monospace font?
>>>
>>>It's not HTML, btw. it's plain text, that I'm trying to send with Outlook 2000, and I know, because I set it up to do so.
>>>
>>>Because I'm still testing, I'm the only receipient. So I also know that I get it as Rich text. Which really is not so bad, except the font is all wrong, and I don't want the receipient to have to choose a monospace font.
>>>
>>>BR
>>>
>>>
>>>>How do you know that recipient is viewing it as HTML? Maybe the Font for plain text messages is set to proportional font which will screw the text formatting as well?
>>>>
>>>>>I do, and it does.
>>>>>
>>>>>>If you fill the .Body (rather than the .HTMLBody) it should arrive as text. Or does the recipient's Outlook still looks at the message as HTML?
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform