Sending messages with HTML contents using the MAPI control in VB6 -
how can send mail using mapi html body? need create table in message body. i'm using vb6 , mapi control. ideas?
function mailsend(ssendto string, ssubject string, stext string) boolean on error goto errhandler mapisession1 if .sessionid = 0 .downloadmail = false .logonui = true .signon .newsession = true mapimessages1.sessionid = .sessionid end if end mapimessages1 .compose .recipaddress = ssendto .addressresolveui = true .resolvename .msgsubject = ssubject .msgnotetext = stext .send false end mailsend = true exit function errhandler: 'msgbox err.description mailsend = false end function
mapi control uses simple mapi, not handle html. there trick when using simple mapi directly (mapisendmail) - set body null , attach , html file: used message body. don't know if trick work mapi control.
why not switch using outlook object model? capable of handling html:
set app = createobject("outlook.application") set ns = app.getnmaespace("mapi") ns.logon set msg = app.createitem(0) msg.to = ssendto msg.subject = ssubject msg.htmlbody = syourhtmlbody msg.send 'or msg.display
Comments
Post a Comment