How to send HTML format mail via MAPI

  • Thread starter Thread starter Bill Li
  • Start date Start date
B

Bill Li

Hello all,

It is possible to send mail via CDO(Collaboration Data
Objects) without via Outlook application. Following is the
code I used to send mail using the MAPI.Session of CDO.

Dim ObjSession
Dim ObjMessage
Dim ObjRecipe

set ObjSession=CreateObject("MAPI.Session")
ObjSession.Logon "MS Exchange Settings"

Set ObjMessage=ObjSession.Outbox.Message.Add
ObjMessage.Subject="Test"
ObjMessage.Text="This is a test"

Set ObjRecipe=ObjMessage.Recipients.Add
ObjRecipe.Name="XXXXXX"
ObjRecipe.Type=1
ObjRecipe.Resolve

ObjMessage.Send

ObjSession.logoff

The above code could send TEXT fromat email. However, I
couldn't send out HTML format email. Does any people have
idea how to send HTML format email via MAPI.Session?
Thanks a lot!

Best Regards

Bill
 
Back
Top