vb.net - Send mht file in body email -


hello using sendgridmessage() object vb.net send emails through sendgrid smtp server.
have .mht file want send in mail body...

i know possible send pure html in mail body when read mht file , put on mail body, appears messed this: email mht , wanted this: mht file

this code:

dim mymsg new sendgridmessage()  mymsg.addto("email@email.com") mymsg.from = new mailaddress(apiemail, apiusername) mymsg.subject = "test mht file" mymsg.html = ""  dim fso new filesystemobject dim ts textstream  'open file. ts = fso.opentextfile(spath) 'loop while not @ end of file. while not ts.atendofstream mymsg.html += ts.readline  loop 'close file. ts.close()  dim credentials = new networkcredential(apiuser, apikey) dim transportweb = new web(credentials) transportweb.deliverasync(mymsg) 

you need convert .mht file regular html first use in way. mht contains metadata , structured differently html, can't use in parameter expects html. mht more mime message. if want deal mime via mht, sending on smtp easier.


Comments