Aegis Implicit Mail AIM AlternateView in MimeMailMessage -
i using aim aegis implicit mail send implicit ssl mails.
when using subject , body in mail message fine, when use alternate views mai lhas empty body. alternate view setup works mailmessage , has html , text body depending on reciving client must use mimemailmessage looks ok in debug code empty when recivied in mailbox.
here's code:
string plaintextbody = "welkom."; alternateview plaintextview = alternateview.createalternateviewfromstring( plaintextbody, null, mediatypenames.text.plain); plaintextview.contenttype = new system.net.mime.contenttype("text/plain"); mail.alternateviews.add(plaintextview); string htmlbody = @"<html><body><img src=""cid:logo""><br /> welkom </body></html>"; alternateview htmlview = alternateview.createalternateviewfromstring(htmlbody, null, mediatypenames.text.html); htmlview.contenttype = new system.net.mime.contenttype("text/html"); string imagesource = path.combine(httpruntime.appdomainapppath, @"content\images\logob.png"); linkedresource pictureres = new linkedresource(imagesource, mediatypenames.image.jpeg); pictureres.contentid = "logo"; htmlview.linkedresources.add(pictureres); mail.alternateviews.add(htmlview);
aim not providing alternativeview, can use inline attachments put images , directly set html code in message body. try download sample code , have on how inline attachments working
Comments
Post a Comment