Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: Get Email Contents Html/Plain Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
bravedave
Newbie
Newbie


Joined: 05 September 2014
Location: Australia
Online Status: Offline
Posts: 35
Posted: 20 March 2015 at 2:41am | IP Logged Quote bravedave

This example shows reading a folder - eg. inbox
http://www.afterlogic.com/wiki/Getting_new_or_last_messages_(MailSuite_Pro)

and it works, but

if I use the Html() or Plain() functions on the message - it returns nothing

I think I should be able to write:
Code:

$oCollection->ForeachList(function ($oMessage) {
  $oFrom = $oMessage->From();
  echo "\t".htmlentities($oMessage->Uid().') '.$oMessage->Subject().($oFrom ? ' ('.$oFrom->ToString().')' : ''))."\n";
  echo htmlentities($oMessage->Plain());
});


but that just return an empty string
Back to Top View bravedave's Profile Search for other posts by bravedave
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 20 March 2015 at 3:09am | IP Logged Quote Igor

This example is only about getting message headers, i.e. the information needed to display message list, message bodies are not downloaded. To display message body, you'd need to download the message first:

Code:
$oFullMessage = $oApiMailManager->Message($oAccount,$sFolder,$oMessage->Uid());
echo htmlentities($oFullMessage->Plain());


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


Joined: 05 September 2014
Location: Australia
Online Status: Offline
Posts: 35
Posted: 20 March 2015 at 3:22am | IP Logged Quote bravedave

Thanks Igor - just what I needed
Back to Top View bravedave's Profile Search for other posts by bravedave
 

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