help with e-mail

dmonney

Registered User.
Local time
Today, 17:14
Joined
Dec 3, 2007
Messages
31
I'm trying to use VBA to send an e-mail through outlook. When outlook opens all my HTML formating goes away. It adds in my page breaks, but it will not add in any coloring or font changes. I have checked and my mail format is HTML, I have tried using WORD as my mail editor and not using WORD as my mail editor.

PHP:
Private Sub Command144_Click()
On Error GoTo Err_Command144_Click


       Dim O As Outlook.Application
       Dim m As Outlook.MailItem
       Dim varMessage As String
       


Set O = CreateObject("Outlook.Application")
Set m = Outlook.CreateItem(0)
varMessage = "<RED> Here are todays Reports </RED> " & ". <BR><BR>" & _
"Thank You,<BR><BR>" & _
"John Smith<BR>" & _
" email@hidden.com " & " <BR><BR>"

With m
'.Display
.BodyFormat = olFormatHTML
m.To = "to@to.com"
m.CC = ""

.Subject = "100% OTD Report"
.HTMLBody = "Content-Type: Text/HTML" & vbCrLf & varMessage
.Display 'Or use Send
End With


    
Exit_Command144_Click:
    Exit Sub

Err_Command144_Click:
    MsgBox Err.Description
    Resume Exit_Command144_Click
    
End Sub
 

Users who are viewing this thread

Back
Top Bottom