aharrisreid
Programmer
I am using OLE automation with VFP and Outlook to create emails from VFP data using something like the code below...
* -----------------------------
lcHTMLString = my message formatted as html
lcHTMLString = [<html><body>]+lcHTMLString+[</body>] && add HTML body code
oOutlook = CREATOBJECT('Outlook.application')
oItem = oOutlook.createitem(0) && create new mail message
WITH oItem
.recipients.add(emailaddress)
.subject = MySubject"
.HTMLBody = lcHTMLString
.save()
.send()
ENDWITH
* -----------------------------
If I select to send the emails immediately they are generated, the received emails look fine, but if I try to view the sent version (ie. the message stored in the 'out-tray'), the body of the email is blank! Is this because I have used the .HTMLBody property instead of .body?
I originally did use oItem.body to store the message, and that worked fine, until I needed to line-up some data halfway through the message and use a non-proportional font. Placing <FONT FACE="Courier New"> and </FONT> in the text string did not work - it output literally, that's why I resorted to an HTML string solution.
a) If I use the .HTMLBody property, how can I view the emails before transmission?
b) If I use the .body property, how can I embed HTML formatting tags?
Any help would be appreciated.
Alan Harris-Reid