Create HTML email message in th outbox

  • Thread starter Thread starter Harold Druss
  • Start date Start date
H

Harold Druss

Hi
I have never used the Outlook object model with VB6 before, so excuse my
ignorance. I'm trying to create a new email, insert the HTML file into the
body of the email and put it in the outbox for sending later.
Here is part of the code.

==============================================================

Dim ff As Long
ff = FreeFile
strFile = "C:\Program Files\Microsoft Visual
Studio\VB98\Projects\SummerTwi2\SummerTwi.htm"
Open strFile For Input As #ff
strHTML = Input(LOF(ff), #ff)
Close #ff
Debug.Print strHTML
strSubject = "Summer Twi"
strRecip = "(e-mail address removed)"
strMsg = "The Summer Twi Information"
If GetOutlook = True Then
Set mItem = mOutlookApp.CreateItem(olMailItem)
mItem.Recipients.Add strRecip
mItem.Subject = strSubject
mItem.HTMLBody = strHTML

mItem.Save
mItem.Send
End If
========================================================================

The email is in the outbox, but no html in the body.
Thank you
Harold
 
Hi Harold,

what version do you use and why do you think the mail format isn´t html?
 
Back
Top