ActiveSync Fetch Command. How to Get MessageID - exchangewebservices

Use ItemOperations to get a message:
How do I get the Headers in Particular the MessageID for the Email?
I'm confused the example on MSDN clearly shows the email Header.
http://msdn.microsoft.com/en-us/library/ee220018%28v=EXCHG.80%29.aspx
Am I missing an additional command/field/Flag?
Thanks,
Pat
Environment
Exchange 2003 Protocol: 12.1 ActiveSync
IN:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<ItemOperations xmlns:airsync=\"AirSync:\" xmlns:airsyncbase=\"AirSyncBase:\" xmlns=\"ItemOperations:\">
<Fetch>
<Store>Mailbox</Store>
<airsync:CollectionId>6</airsync:CollectionId>
<airsync:ServerId>6:1</airsync:ServerId>
<Options>
<airsync:MIMESupport>1</airsync:MIMESupport>
<airsyncbase:BodyPreference>
<airsyncbase:Type>2</airsyncbase:Type>
<airsyncbase:TruncationSize>5120</airsyncbase:TruncationSize>
<airsyncbase:AllOrNone>0</airsyncbase:AllOrNone>
</airsyncbase:BodyPreference>
</Options>
</Fetch>
</ItemOperations>
OUTPUT:
XML Response:
<?xml version="1.0" encoding="utf-8"?>
<itemoperations:ItemOperations xmlns:itemoperations="ItemOperations:">
<itemoperations:Status>1</itemoperations:Status>
<itemoperations:Response>
<itemoperations:Fetch>
<itemoperations:Status>1</itemoperations:Status>
<airsync:CollectionId xmlns:airsync="AirSync:">6</airsync:CollectionId>
<airsync:ServerId xmlns:airsync="AirSync:">6:1</airsync:ServerId>
<airsync:Class xmlns:airsync="AirSync:">Email</airsync:Class>
<itemoperations:Properties>
<email:To xmlns:email="Email:">"pat2 pm. mol" <pat2.test#dhmars.loc&g
t;</email:To>
<email:From xmlns:email="Email:">"pat2 pm. mol" <pat2.test#dhmars.loc
></email:From>
<email:Subject xmlns:email="Email:">TESTMAIL</email:Subject>
<email:DateReceived xmlns:email="Email:">2011-12-06T15:22:24.613Z</email
:DateReceived>
<email:DisplayTo xmlns:email="Email:">pat2 pm. mol</email:DisplayTo>
<email:ThreadTopic xmlns:email="Email:">TESTMAIL</email:ThreadTopic>
<email:Importance xmlns:email="Email:">1</email:Importance>
<email:Read xmlns:email="Email:">1</email:Read>
<airsyncbase:Body xmlns:airsyncbase="AirSyncBase:">
<airsyncbase:Type>2</airsyncbase:Type>
<airsyncbase:EstimatedDataSize>1627</airsyncbase:EstimatedDataSize>
<airsyncbase:Data><html>
<head>
<style>
<!--
#font-face
{font-family:"Cambria Math"}
#font-face
{font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline}
span.EmailStyle17
{font-family:"Calibri","sans-serif";
color:windowtext}
.MsoChpDefault
{font-family:"Calibri","sans-serif"}
#page WordSection1
{margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.WordSection1
{}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">&nbsp;</p>
</div>
</body>
</html>
</airsyncbase:Data>
</airsyncbase:Body>
<email:MessageClass xmlns:email="Email:">IPM.Note</email:MessageClass>
<email:InternetCPID xmlns:email="Email:">20127</email:InternetCPID>
<email:Flag xmlns:email="Email:" />
<email:ContentClass xmlns:email="Email:">urn:content-classes:message</em
ail:ContentClass>
<airsyncbase:NativeBodyType xmlns:airsyncbase="AirSyncBase:">2</airsyncb
ase:NativeBodyType>
</itemoperations:Properties>
</itemoperations:Fetch>
</itemoperations:Response>
</itemoperations:ItemOperations>

You have set airsyncbase:Type = 2. This gives you an HTML response.
You need to set Type = 4 if you want a full MIME response. That will have all the headers that you need.
See 2.2.2.22 Type of [MS-ASAIRS]: Exchange ActiveSync: AirSyncBase Namespace Protocol at http://msdn.microsoft.com/en-us/library/hh475675(v=exchg.80).aspx.

Seems ok, but, first of all, you have to check if the request support a ASAcceptMultiPart:
http://msdn.microsoft.com/en-us/library/ee159875%28v=EXCHG.80%29.aspx

Related

Arabic Character Support - Html (ASCII) - XNA

What is the extent of Arabic letters in HTML?
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Graphics="ReLogic.Content.Pipeline">
<Asset Type="Graphics:DynamicFontDescription">
<FontName>aboodedcF1</FontName>
<Size>14</Size>
<Spacing>0</Spacing>
<UseKerning>true</UseKerning>
<Style>Bold</Style>
<DefaultCharacter>*</DefaultCharacter>
<VerticalOffset>DefaultFontAscent</VerticalOffset>
<CharacterRegions>
<CharacterRegion>
<Start> </Start>
<End>©</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>
between
<CharacterRegion>
<Start> </Start>
<End>©</End>
</CharacterRegion>
I searched a lot on the internet and didn't find anything
<!-- arabic Characters -->
<CharacterRegion>
<FontName>Anaqa</FontName> <!-- font name -->
<Size>30</Size>
<Style>Regular</Style>
<Start>؀</Start>
<End>ۿ</End>
</CharacterRegion>
<CharacterRegion>
<FontName>Anaqa</FontName> <!-- font name -->
<Size>30</Size>
<Style>Regular</Style>
<Start>ﹰ</Start>
<End></End>
</CharacterRegion>

gContact namespace not working

I am trying to POST contact data to GContact to create a new contact. I can create a new contact if I use only "gd" XML elements, but when I try and post a "gContact" element it gives me an error. I'm sure it's something simple because I am a total amateur, but I would appreciate any help.
This works
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact" />
<gd:name>
<gd:givenName>Jack</gd:givenName>
<gd:familyName>Masters</gd:familyName>
<gd:fullName>Jack Masters</gd:fullName>
<gd:additionalName>Rascal</gd:additionalName>
<gd:namePrefix>Sir</gd:namePrefix>
<gd:nameSuffix>II</gd:nameSuffix>
</gd:name>
<atom:content type="text">These are some testing notes.</atom:content>
<gd:email rel="http://schemas.google.com/g/2005#work" address="newtestAddress#gmail.com" primary="true" />
<gd:phoneNumber rel="http://schemas.google.com/g/2005#home" primary="true">716-999-0098</gd:phoneNumber>
<gd:phoneNumber rel="http://schemas.google.com/g/2005#work">666-8765-9087</gd:phoneNumber>
<gd:structuredPostalAddress rel="http://schemas.google.com/g/2005#home">
<gd:formattedAddress>3546 Madison Street, Chicago IL, 56879</gd:formattedAddress>
<gd:street>3546 Madison Street</gd:street>
<gd:city>Chicago</gd:city>
<gd:state>IL</gd:state>
<gd:country>USA</gd:country>
</gd:structuredPostalAddress>
</atom:entry>
But this doesn't
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:gd="http://schemas.google.com/g/2005">
<atom:category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact" />
<gd:name>
<gd:givenName>Jack</gd:givenName>
<gd:familyName>Masters</gd:familyName>
<gd:fullName>Jack Masters</gd:fullName>
<gd:additionalName>Rascal</gd:additionalName>
<gd:namePrefix>Sir</gd:namePrefix>
<gd:nameSuffix>II</gd:nameSuffix>
</gd:name>
<atom:content type="text">These are some testing notes.</atom:content>
<gd:email rel="http://schemas.google.com/g/2005#work" address="newtestAddress#gmail.com" primary="true" />
<gd:email rel="http://schemas.google.com/g/2005#home" address="evenNewerAddress#yahoo.com" />
<gd:phoneNumber rel="http://schemas.google.com/g/2005#home" primary="true">716-999-0098</gd:phoneNumber>
<gd:phoneNumber rel="http://schemas.google.com/g/2005#work">666-8765-9087</gd:phoneNumber>
<gd:structuredPostalAddress rel="http://schemas.google.com/g/2005#home">
<gd:formattedAddress>3546 Madison Street, Chicago IL, 56879</gd:formattedAddress>
<gd:street>3546 Madison Street</gd:street>
<gd:city>Chicago</gd:city>
<gd:state>IL</gd:state>
<gd:country>USA</gd:country>
</gd:structuredPostalAddress>
<gContact:groupMembershipInfo href="http://www.google.com/m8/feeds/groups/default/base/14b3e56788eb41b8" />
</atom:entry>
I have tried a number of different gContact elements and nothing seems to work. I get a 400 HTTP response code every time.
This is the response detail. I can't seem to figure where the error is.
Optional(<NSHTTPURLResponse: 0x600000234480> { URL: https://www.google.com/m8/feeds/contacts/default/full?alt=json } { status code: 400, headers {
"Cache-Control" = "private, max-age=0";
"Content-Encoding" = gzip;
"Content-Type" = "text/plain; charset=UTF-8";
Date = "Tue, 07 Mar 2017 16:02:17 GMT";
Expires = "Tue, 07 Mar 2017 16:02:17 GMT";
Server = GSE;
"alt-svc" = "quic=\":443\"; ma=2592000; v=\"36,35,34\"";
"x-content-type-options" = nosniff;
"x-frame-options" = SAMEORIGIN;
"x-xss-protection" = "1; mode=block"; } })
You may want to try these recommended actions for error code 400 as given in Standard Error Responses:
invalidParameter
Do not retry without fixing the problem. You need to provide a valid value for the parameter specified in the error response.
badRequest
Do not retry without fixing the problem. You need to make changes to the API query in order for it to work.
You may want to also check this related SO post for additional insights that might help you.
I figured it out. I was literally formatting every gContact element that I was trying incorrectly. I had tried 4 separate things and wrongly assumed it was something contextual I hadn't set. In reality I had formatted all four wrong in different ways. New programmer lesson learned.

Write HTML code to open PDF in browser

I generate an html file from word document which has some links to pdf file. When I open it in some browsers, they download prompt comes up. What I need, is to open the pdf file in the same browser window.
I read that one solution is to include the following commands in header file:
Content-Type: application/pdf
Content-Disposition: inline; "filename.pdf"
However, I don't know which part of my pdf file I have to put them. Here is the header of my html code.
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=Generator content="Microsoft Word 14 (filtered)">
<base href=x>
<title>Welcome to SELSE-1, which we anticipate will be the first of a series of
annual workshops to bring together experts from both industry and academia to
discuss current and future trends in Soft Error Upset (SEU) rates and the state
of the art and possible</title>
<style>
<!--
/* Font Definitions */
#font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
#font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
#font-face
{font-family:"MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
#font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
#font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
#font-face
{font-family:"Lucida Grande";}
#font-face
{font-family:"\#MS Mincho";
panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
h2
{mso-style-link:"Heading 2 Char";
margin-right:0in;
margin-left:0in;
font-size:18.0pt;
font-family:"Times New Roman","serif";
font-weight:bold;}
p.MsoCommentText, li.MsoCommentText, div.MsoCommentText
{mso-style-link:"Comment Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{mso-style-link:"Header Char";
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{mso-style-link:"Footer Char";
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{margin-right:0in;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.MsoCommentSubject, li.MsoCommentSubject, div.MsoCommentSubject
{mso-style-link:"Comment Subject Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Times New Roman","serif";
font-weight:bold;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
p.MsoRMPane, li.MsoRMPane, div.MsoRMPane
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.maroon
{mso-style-name:maroon;}
span.HeaderChar
{mso-style-name:"Header Char";
mso-style-link:Header;
font-family:"Times New Roman","serif";}
span.FooterChar
{mso-style-name:"Footer Char";
mso-style-link:Footer;
font-family:"Times New Roman","serif";}
span.Title1
{mso-style-name:Title1;}
span.authors
{mso-style-name:authors;}
span.CommentTextChar
{mso-style-name:"Comment Text Char";
mso-style-link:"Comment Text";}
span.CommentSubjectChar
{mso-style-name:"Comment Subject Char";
mso-style-link:"Comment Subject";
font-weight:bold;}
span.Heading2Char
{mso-style-name:"Heading 2 Char";
mso-style-link:"Heading 2";
font-family:"Times New Roman","serif";
font-weight:bold;}
p.p1, li.p1, div.p1
{mso-style-name:p1;
margin-right:0in;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.Default, li.Default, div.Default
{mso-style-name:Default;
margin:0in;
margin-bottom:.0001pt;
text-autospace:none;
font-size:12.0pt;
font-family:"Arial","sans-serif";
color:black;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
.MsoChpDefault
{font-size:10.0pt;}
/* Page Definitions */
#page WordSection1
{size:8.5in 11.0in;
margin:1.0in 89.85pt 64.9pt 89.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
</head>
You can't force a browser to display a PDF, but you can tell it that it can if it is already set up to do so.
What you need to do is serve the file with the headers you mentioned. This tells the browser that the content it's loading is actually a PDF, and if it set up to open PDF's it will. Otherwise, a download is likely to be initiated.
More specifically, you need to attach the headers to the response given by the web-server when it fetches the file. The actual application can vary widely depending on your web-server and on how you're serving the file.
For example, if the file is served through a servlet, you can set the content-type inside the servlet (java):
response.setContentType("application/pdf");
If it is served directly (as in, you're just linking to the file with <a>) then you need to set this up on a server scale. For example, in tomcat you set this up in the web.xml file like so:
<mime-mapping>
<extension>pdf</extension>
<mime-type>application/pdf</mime-type>
</mime-mapping>
This sets the server in a way that any file served with a .pdf extension automatically receives the proper content-type.

Applying MathML XSLT on HTML containing XML

I have a HTML document that contains inline OMML. Is it possible to apply XSLT transformations to this inline XML somehow and get back a HTML with MathML? Probably have to use OMML2MML.xsl somehow. After that I could use mathjacx to actually render the equations for display.
<html>
<head>
</head>
<body>
<xml id="sheet1" src="OMML2MML.XSL">
<m:oMath xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
<m:sSub>
<m:sSubPr>
<m:ctrlPr>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:i/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
<w:lang w:val="et-EE"/>
</w:rPr>
</m:ctrlPr>
</m:sSubPr>
<m:e>
<m:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
<w:lang w:val="et-EE"/>
</w:rPr>
<m:t>N</m:t>
</m:r>
</m:e>
<m:sub>
<m:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
<w:lang w:val="et-EE"/>
</w:rPr>
<m:t>3</m:t>
</m:r>
</m:sub>
</m:sSub>
</m:oMath>
</xml>
</body>
</html>
Thanks for any help!
Ok this is what I ended up doing:
Got OMML from Apache POI
Converted that to MathML with javax.xml.transform.Transformer and passing in the OMML2MML.xsl
Removed root node namespace from MathML with plain string manipulation
Directly injected the MathML to HTML
Used mathjax to render the formulas.

FindFirstHtmlVersion just returning more html

The openPop function just returns a load of HTML which is difficult to find a way to parse. Has anyone got any ideas on how I should further parse the html so I can get the body of text I need? I've tried getbodyastext method which didn't seem to be of any use.
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-
com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
#font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
#font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
#font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
#page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Test Email for dev_sitehelpdesk<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'> <o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'>NAME HERE</span></b><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:EN-GB'>Technical Manager<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>=
I use this function I modified from the comment link below:
private string GetMessageBodyAsTextNew(Message message)
{//http://www.limilabs.com/blog/tag/html
string body;
MessagePart plainTextPart = message.FindFirstPlainTextVersion();
if (plainTextPart != null)
{
// The message had a text/plain version - show that one
body = plainTextPart.GetBodyAsText();
}
else
{
// Try to find a body to show in some of the other text versions
MessagePart html = message.FindFirstHtmlVersion();//http://hpop.sourceforge.net/exampleSpecificParts.php
if (html != null)
{
// Save the plain text to a file, database or anything you like
//body = GetMessageBodyAsText(message);
body = GetTextFromHtml_Xpath(html.GetBodyAsText());
}
else
{
body = "The system was unable to get the body text of this message";
}
}
return body;
}
Used regex to strip out most of the HTML and put in carriage returns. I know you shouldn't use regex to parse html, but this is limited HTML that I just wanted to get rid of. Works fairly well.