Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: Include message details in html output Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
tcromer
Newbie
Newbie


Joined: 15 July 2009
Online Status: Offline
Posts: 1
Posted: 15 July 2009 at 7:09am | IP Logged Quote tcromer

Hi,

I am using the GetHtmlAndSaveRelatedFiles method of the MailMessage object to save messages to disk. Is there anyway I can get the message header/detail (From, Sent, To, Subject, etc...) included at the top of the html similar to what Outlook does when printing an email?

Is there a property I can set to have this included or will I need to manipulate the html manually to insert this?

Regards
Trent
Back to Top View tcromer's Profile Search for other posts by tcromer
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6094
Posted: 16 July 2009 at 2:23am | IP Logged Quote Igor

Yes, you'll need to manipulate HTML content manually.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
rre
Newbie
Newbie
Avatar

Joined: 04 September 2009
Location: Italy
Online Status: Offline
Posts: 7
Posted: 08 September 2009 at 6:36am | IP Logged Quote rre

Hi,

I had the same problem and the support suggest me to :

1) prepare an html string with to/from
2) attach the string received from GetHtmlAndSaveRelatedFiles
3) write the string.

My code:

8<-------------------------------------------
msg.Parser.WorkingFolder = tmpPath & TmpDir

sw = New StreamWriter(tmpPath & TmpDir & "\Index.html", False)

msg = pop.DownloadEntireMessage(pop.GetMessageIndexFromUid(Udi))

msg.Parser.PlainToHtmlMode = PlainToHtmlAutoConvert.IfNoHtml
msg.Parser.PlainToHtmlOptions = PlainToHtmlConvertOptions.UriToLink

msg.Parser.Apply()

sw.write(MyHeader())
sw.Write(msg.GetHtmlAndSaveRelatedFiles(Nothing, VirtualMappingType.NonWeb, MessageFolderBehavior.CreateOnly))

[...]

Public Function MyHeader() As String
Dim result As String = ""

result += "<div class=MyHeader>" + (vbCrLf)
result += "<b>From        :</b> Pippo <br>" + (vbCrLf)
'[and so on...]
result += "<hr />" + (vbCrLf)
result += "</p>" + (vbCrLf)
result += "</div>" + (vbCrLf)

Return result
End Function

8<-------------------------------------------

ciao

RRE
Back to Top View rre's Profile Search for other posts by rre
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide