How to send HTML format mail via MAPI

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top