Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: Parse message method Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
AIWEB
Groupie
Groupie
Avatar

Joined: 19 October 2010
Location: United States
Online Status: Offline
Posts: 54
Posted: 05 December 2010 at 8:30am | IP Logged Quote AIWEB

Is there an API method or chunk of code I could use as a method of posting an email message body? I
have been using a self built class to render the .eml files but it's buggy.. Maybe I can tap into the code
that webmail uses to parse the message and then I could maintain congruency.

something around the lines of the below would be great though it doesn't have to be that easy lol.

$user=new wm_user;
$user->getEmailByID(msg_id); //Returns content of message

I don't need attachments or anything just HTML/plain body of the message. Any help or direction would
be great!

Many thanks!

Ryan
Back to Top View AIWEB's Profile Search for other posts by AIWEB
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 06 December 2010 at 3:07am | IP Logged Quote Igor

According to the developers, there's no such method you could use straight away, and the approach you should take heavily depends on protocol type (IMAP/POP3) and synchronization mode you use. For instance, with Direct Mode used, messages are not stored in database or on filesystem, so it would be necessary to connect to mail server, locate particular mail, retrieve and parse it. To get the idea of how things like this are done, check common/class_processorswitch.php, you'd want to take a look at methods with names starting from Do.

Hope this helps!

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

Joined: 19 October 2010
Location: United States
Online Status: Offline
Posts: 54
Posted: 06 December 2010 at 2:51pm | IP Logged Quote AIWEB

Interesting, I am using POP3 so I DO have the messages in file to work with. And ALL of my accounts will
be of this type. I did/do have an 80% working method using the files in /data/email. But it's ugly and
text/plain vs. text html throws up my script. I keep finding different header / content separator types and
probably brute forcing it too much.

I appreciate it, and will look into the class page you mentioned above.

Thanks a ton!

Ryan Thompson
Back to Top View AIWEB's Profile Search for other posts by AIWEB
 

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