MIME type text/xml shown as inline in email applications

Hi, I am currently using MimeBodyPart object to set the text for the email, using the setDataHandler() method. The problem is when i use the MIME content as text/plain or text/html, the text is showing inline in my email application.
However problem arises when i use the text/xml MIME content type, the text is not shown as inline, it is set as an attachment. I want to know if at all text/xml can be shown as inline text in an email application or will it be always appear as an attachment.

Hi Saurab,
Currently im also facing the same issue as urs. Im trying to send a disclaimer in the email which contains some special characters such as / : ;
The client is also using MS outlook to read the mails. They are receiving the disclaimer as an attachment instead of as plain text.Below is the format of my email:
1. Body of the mail
2. Actual report of the client sent as an attachment
3. disclaimer
In the forum(http://forums.sun.com/thread.jspa?threadID=5323022) it was mentioned that if the attachment is sandwitched with test, then the text following the attachment will also be sent as an attachment. Hence i just swapped the steps 2 and 3 and had the report as a final one.but still the client receives the disclaimer as an attachment. Your help will be appreciated.

Similar Messages

  • Error consuming Web service - content type text/xml;charset=utf-8 of the response message does not match the content type of the binding

    Hi all,
    We are trying to interact with Documentum server through DFS exposed WCF which communicates through port 9443 and we are provided with documentum issued Public Key certificates. We have successfully imported the certificates in client machine and configured
    the bindings as below in our .Net web application config file.
    <system.serviceModel>
    <bindings>
    <wsHttpBinding>       
    <binding
    name="ObjectServicePortBinding1">
    <security
    mode="Transport">
    <transport
    clientCredentialType="None"
    proxyCredentialType="None"
    realm=""
    />
    <message
    clientCredentialType="Certificate"
    algorithmSuite="Default"
    />
    </security>
    </binding>
    <binding
    name="QueryServicePortBinding">
    <security
    mode="Transport">
    <transport
    clientCredentialType="None"
    proxyCredentialType="None"
    realm=""
    />
    <message
    clientCredentialType="Certificate"
    algorithmSuite="Default"
    />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>
    Also, we set the message encoding as MTOM and the wcf client object initialization code snippet is as below,
    ObjectServicePortClient
    serviceClient = new
    ObjectServicePortClient(new
    WSHttpBinding("ObjectServicePortBinding1"),
    new
    EndpointAddress(UriUtil.ObjectServiceUri));
    if (serviceClient.Endpoint.Binding
    is
    WSHttpBinding)
       WSHttpBinding
    wsBinding = serviceClient.Endpoint.Binding as
    WSHttpBinding;
    wsBinding.MessageEncoding =
    "MTOM".Equals(transferMode) ?
    WSMessageEncoding.Mtom :
    WSMessageEncoding.Text;
    serviceClient.Endpoint.Behaviors.Add(new
    ServiceContextBehavior(Config.RepositoryName,
    Config.DocumentumUserName,
    Config.DocumentumPassword));
    When we execute the above code, we are getting error message as below,
    Exception: The content type text/xml;charset=utf-8 of the response message does not match the content type of the binding (multipart/related; type="application/xop+xml"). If using a custom encoder, be sure that the IsContentTypeSupported
    method is implemented properly. The first 407 bytes of the response were: '<?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope"><faultcode>S:VersionMismatch</faultcode><faultstring>Couldn't
    create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got http://www.w3.org/2003/05/soap-envelope </faultstring></S:Fault></S:Body></S:Envelope>'
    Then, we changed the bindings as below
    <system.serviceModel>
    <bindings>
    <wsHttpBinding>       
    <binding
    name="ObjectServicePortBinding1">
    <security
    mode="Transport">
    <transport
    clientCredentialType="Certificate"
    proxyCredentialType="None"
    realm=""
    />
    <message
    clientCredentialType="Certificate"
    algorithmSuite="Default"
    />
    </security>
    </binding>
    <binding
    name="QueryServicePortBinding">
    <security
    mode="Transport">
    <transport
    clientCredentialType="
    Certificate"
    proxyCredentialType="None"
    realm=""
    />
    <message
    clientCredentialType="Certificate"
    algorithmSuite="Default"
    />
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>
    We are getting another error message,
    Exception: The client certificate is not provided. Specify a client certificate in ClientCredentials.
    Any pointers on resolving this issue would be highly helpful.
    Thanks

    Hi Dhanasegaran,
      As per your case, the corresponding details which may guide you to resolve this issue:
    1. First of all, you can try to call the wcf service directly from the browser & check where it will point out the correct location.
    2. In config file ,Set IncludeExceptionDetailInFaults to true to enable exception information to flow to clients for debugging purposes .
    Set this to true only during development to troubleshoot a service like below :
    <serviceBehaviors>
      <behavior name="metadataAndDebugEnabled">
        <serviceDebug
          includeExceptionDetailInFaults="true"   
    />
        <serviceMetadata
          httpGetEnabled="true"
          httpGetUrl=""   
    />
      </behavior>
    </serviceBehaviors>
    3. I suggest you to change that <security mode ="TransportWithMessageCredential"> instead of <security mode ="Transport">
     for more information, refer the following link :
    https://msdn.microsoft.com/en-us/library/aa354508(v=vs.110).aspx

  • How to change the HTTP Response as XML (Content Type "text\xml")  When Post

    Hi Friends ,
    I have created one RFC Destination TYPE H . When i am trying to post some XML Message to that particular HTTP Service using POST method . It succesfully accepted the XML File but , it is returning the String as " OK" . In the connection test trace i have seen the Content Type as "text/html" but * I need to get as XML format no Srting    ( Type "text\xml" . ) *
    I need to get response back as XML not plain text .
    1 Any Configuration setting do we need to do on Service (SICF ) ?
    2. Or any other place we need to modify to get the HTTP Response as XML not plain text
    Can you please help to solve the problem . Any clue ?
    Thanks & Regards.,
    V.Rangarajan

    Dear users,
    we have requirement sending SMS to the customers mobiles. I am successfully sending the messages to the customers mobiles by using the above method. Facing issues with response message. The response messages is in plain text fromat in single line like...Sent
    Using HTTP_AAE Receiver adapter.
    The response message was failed while excution of the message mapping with the error
    Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_SMS_CUST_RES_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog.
    please share the comments how to pass the Status of the message to SAP ECC from SAP HTTP adapter
    Regards,
    Sudir.

  • How to change content-type (text/xml;charset=utf-8)  in SOAP receiver?

    Hi,
    How can I change the content-type (text/xml;charset=utf-8) sent by the SOAP adapter to an external webservice?
    I need to sent text/xml  as content-type to the webservice, otherwise I get an error.
    I have tried with different adapter modules but so far no positive results.
    Thanks.
    Edited by: Roberto Viana on Mar 26, 2009 2:02 PM

    Hi Stefan, many thanks for your answer.
    According to your answer it is not possible to manipulate/change the way PI fills the content-Type.
    I was hoping to solve the issue with a custom built adapter module that sets the HTTP header content-type to text/xml without the charset entry, but I understand that's not the case.
    Regards,
    Roberto Viana

  • Gnome: every file has mime-type text/plain

    since yesterday (i did some updates with pacman but i dont know what packages...) my gnome (nautilus) wants to open ERVERY file with the text editor because it wrongly determines the mime-type text/plain for all files.
    what happened?

    http://bbs.archlinux.org/viewtopic.php?pid=384949

  • Unable to add Content-Type=multipart/related; type="text/xml";

    hi all
    am trying to add the following to my soap message that include attachment
    but its not working
    Content-Type=multipart/related; type="text/xml";
    boundary="----=_Part_0_14732323.1039686671216";
    Content-Length=4259;
    can any body help plzzzzzzzz

    Hello again,
    My solution works and does not work. Content type is ok, but strange characters appear to the end of the attachment data.
    Like this
    ...</E1EDS01></IDOC></ORDERS01>H úãž6×½ ã½5Õ×¼ÛgžÛNÝ}þ[ëMu201E
    Where did these come from? I tested in a way that I changed the ContentType back to application/xml and attachment is fine again.
    Regards,
    Pekka

  • JAVA MIME Content Type text/xml - as inline mail text

    I have code currently which uses Java Mail to post an email having xml contents. I used the MIME content type as text/xml however the way outlook is showing the mail is as an attachment. I was expecting it to show it inline. Is there any way i can display the text as inline using text/xml. I tried using text/html and the XML message is being displayed as inline, however i wanted text/xml to work. Please suggest a possible solution.

    You want a page which lists all of the possible e-mail clients (Outlook, Hotmail, Lotus Notes, Eudora, Yahoo, Gmail, and dozens of others) and describes how they handle all of the several hundred valid MIME types? Good luck with that.
    No. E-mail clients will handle text/plain inline. Most of them will handle text/html inline most of the time. Anything else, forget it.

  • Mime type for xml

    i am writing a code in jsp which should download a xml file in client machine. now the problem is while loading it is showing to store the .jsp file to be stored which is storing it in xml format , but the alert message shown is showning to save as storexml.jsp which is a jsp extension. i want it to show as a xml extension
    response.setContentType("application/vnd.xml");
    filename="xyz.xml";
    try{     
    int i;
    FileInputStream f=new FileInputStream(filename);
    while((i = f.read()) != -1){
         out.write((char)i);
    }catch(Exception e){
         Log.debug("can not write file in viewxml.jsp,exception :"+e);
         System.out.println("can not write");
    i think the mime type should be something to deal with. could anyone tell me the correct one which will store it showing a .xml format by default.

    but usually in some sites i have seen to upload files which gives a setting , if i dont have a text editor tehn i get the file window to save as document type but i if i have a editor then it should give to save as xml by default.
    even that itried with storing as xls file which works fine there mime type is 'application/vnd-excel'
    but it should work same as well in xml instead of it showing jsp document

  • Incorrect MIME type for XML Data Connection POST requests

    It appears that Xcelsius 2008u2019s XML Data Connection logic does not specify the correct MIME type for the data it sends to the server in its POST request.  Using an HTTP debug proxy, I was able to see that Xcelsius sends XML data in the POST, but is setting a content-type of u201Cx-www-form-urlencodedu201D.  According to the W3C spec:
      http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1
    Data sent with a MIME type of u201Cxxu201D should be encoded as key?value pairs, like this:
      key1=val1&key2=val2&Submit=Submit
    So, what Xcelsius is doing is clearly incorrect.  Worse, if your server process is a Java servlet, you may find that the POSTed data will be gobbled up by the servlet container and you wonu2019t be able to read it using a getInputStream(), or getReader() call because itu2019s already been processed by a call to the getParameter() method.
    The correct mime type for POSTing an XML formatted request from Xcelsius should be "text/xml".
    Wayne

    Hi,
    The Error #2032 your getting is due to the Flash player security.
    To remove this this error you need one crossdomain Xml file in the root directory which actually provides a lot more control over who has access to your data from a SWF. The cross domain policy is attached as crossdomain.xml.
    In the XML file, it is used a wildcard (*). This allows a SWF located on any machine to access your data source. You can certainly use an IP address or domain name to restrict access rather to opening it up completely. I always start with the wildcard to make sure my dashboard works, then start restricting access as necessary.
    Here is a whitepaper with everything you need to know about Flash player security:
    http://www.adobe.com/devnet/flashplayer/articles/flash_player_9_security.pdf
    Please let me know if you need any more clarification.
    Regards,
    Sanjay

  • How to change the HTTP Response as XML (Content Type "text\xml") ?

    Hi Friends ,
                     I have created one RFC Destination TYPE H . When i am trying to post some XML Message to that particular HTTP Service using POST method . It succesfully accepted the XML File but , it is returning the String as  " OK" . In the connection test trace i have seen the Content Type as "text/html" but *  I need to get as "text\xml" .* 
                     I need to get response back as XML not plain text . 
            1  Any Configuration setting  do we need to do on Service (SICF )  ?
             2. Or any other place we need to modify to get the HTTP Response as XML not plain text
                  Can you please help to solve the problem . Any clue ?
    Thanks & Regards.,
    V.Rangarajan
    Edited by: ranga rajan on Jan 2, 2008 2:07 PM

    Dear users,
    we have requirement sending SMS to the customers mobiles. I am successfully sending the messages to the customers mobiles by using the above method. Facing issues with response message. The response messages is in plain text fromat in single line like...Sent
    Using HTTP_AAE Receiver adapter.
    The response message was failed while excution of the message mapping with the error
    Mapping failed in runtimeRuntime Exception when executing application mapping program com/sap/xi/tf/_MM_SMS_CUST_RES_; Details: com.sap.aii.utilxi.misc.api.BaseRuntimeException; Content is not allowed in prolog.
    please share the comments how to pass the Status of the message to SAP ECC from SAP HTTP adapter
    Regards,
    Sudir.

  • Cache blocking: content type: text/xml

    I have an unusual request: Is there a way to prevent caching of a particular file with the content type of "text/xml", alot of these files are small and useless. I would want only a file over 25k to be saved.
    For example a file with that content type wouldn't be saved to cache unless it is over 25k in size. I have 6000 of these types of files which are saved in cache_001, 002 etc.

    There is no built-in way to do that, but an add-on might be able to do it. This one doesn't mention treating files of different sizes in different ways, but if it is otherwise effective, you could check with the developer on whether that feature could be added: [https://addons.mozilla.org/en-US/firefox/addon/bettercache/ BetterCache :: Add-ons for Firefox]. I haven't tried it myself.

  • Mime Type for document class when archiving outlook emails

    Hello team,
    can anybody fill me in how to configue the mime type for .msg files (outlook emails) in the document class msg?

    1) Use SE16 to change table V_TOADD
    2) Add:
    Document Class                 - MSG
    Description                         - Outlook Mail
    MIME type of a Web object - message/rfc822
    You can then associate the MSG document class to document types.
    Eli.

  • Images in servlets mime type text/html

    HI at all,
    <br><br>
    i have the following problem:
    <br><br>
    I cant get an image to be displayed on my web browser unsing a servlet.
    <br><br>
    hier is a sample code of the servlet :
    <br><br>
    package imageservlet;
    <br><br>
    import java.io.*;<br>
    import javax.servlet.*;<br>
    import javax.servlet.http.*;<br>
    <br>
    <br>
    public class ImageServlet extends HttpServlet<br>
    {<br>
    public void doGet(HttpServletRequest request, HttpServletResponse response)<br>
    throws IOException, ServletException<br>
    {<br>
    response.setContentType("text/html");<br>
    PrintWriter out = response.getWriter();<br>
    <br>
    out.println("<html>");<br>
    out.println("<head>");<br>
    out.println("<title>Picture Servlet</title>");<br>
    out.println("</head>");<br>
    out.println("<body>");<br>
    out.println("<p>Picture<p>");<br>
    out.println("<img src=\"images/image.png\" alt=\"image\" width=200 height=100>");<br>
    out.println("</body>");<br>
    out.println("</html>");<br>
    <br>
    }<br>
    }<br>
    <br>
    <br>
    and the web.xml file:<br>
    <br>
    <br>
    <web-app><br>
    <display-name>Image Servlets</display-name><br>
    <description>Image Servlet Test</description><br>
    <servlet><br>
    <servlet-name>ImageServlet</servlet-name><br> <servlet-class>imageservlet.ImageServlet</servlet-class><br>
    </servlet><br>
    <br>
    <servlet-mapping><br>
    <servlet-name>ImageServlet</servlet-name><br>
    <url-pattern>/</url-pattern><br>
    </servlet-mapping><br>
    </web-app><br>
    <br>
    <br>
    the directory structure of the application is:<br>
    <br>
    +---imageservlet<br>
    | +---images<br>
    | | image.png<br>
    | |<br>
    | \---WEB-INF<br>
    | | web.xml<br>
    | |<br>
    | \---classes<br>
    | \---imageservlet<br>
    | ImageServlet.class<br>
    <br>
    <br>
    the image location as provided by the browser after the <br>servlet call is:
    <br>
    http://localhost:8085/imageservlet/images/image.png<br>
    <br>
    <br>
    So my questions are:<br>
    <br>
    - What' wrong in the things above ? <br>
    <br>
    - Waht / how to do get the images displyed on the browser<br> ? (Please note that the mine type is txt/html)
    <br>
    Many thanks for any help<br>
    <br>
    SF.<br>
    <br>
    Message was edited by:
    fahd_saida
    Message was edited by:
    fahd_saida
    Message was edited by:
    fahd_saida

    Hi,<br>
    <br>
    <br>
    Lots of thanks paulcw !!!<br>
    <br>
    I finaly solved the problem.<br>
    <br>
    I had to delete the url-pattrern / and to add the mapping for the image directory, also in the code i used a full path to the image.<br>
    <br>
    thus the relevant parts in the web.xml look now like this:<br>
    <br>
    <br>
    <servlet-mapping><br>
    <servlet-name>ImageServlet</servlet-name><br>
    <url-pattern>/imageservlet</url-pattern><br>
    </servlet-mapping><br>
    <br>
    <servlet-mapping><br>
    <servlet-name>ImageServlet</servlet-name><br>
    <url-pattern>/images</url-pattern><br>
    </servlet-mapping><br>
    <br>
    <br>
    <br>
    <br>
    and the relevant code part lke this:<br>
    <br>
    out.println("<img src=\"" + request.getContextPath() + "/images/image.png\" alt=\"image\" width=200 height=100></img>");<br>
    <br>
    with these settings it works just fine :-)<br>
    <br>
    <br>
    Is there any way to keep the url-pattern / to avoid calling the servlet using this (in my opinion) too long url<br>
    <br>
    http://host:port/imageservlet/imageservlet ???<br>
    <br>
    thanks.<br>
    <br>
    SF.<br>
    <br>

  • MIME type (TEXT/PLAIN) is UNKNOWN in received MMS message

    This has happened occasionally ever since MMS was enabled. And it only happens when someone sends an email (not a text or MMS from another phone) to <[email protected]>. I'm no expert but it seems to me that TEXT/PLAIN should be pretty easy to "decode"!
    Anyway, anybody else have this issue or know how to fix it?
    -- Thanks

    In all cases that I've been able to investigate it's been TEXT/PLAIN. I haven't been able to investigate all occurrences because this issue is trying the patience of some people on the other end.
    For the specific case illustrated in the screen shot the subject is correct as is the jpeg image. However the body of the message was 66 bytes, it is this part the iPhone did not display correctly. I know this because I was able to get the sender to email to my iPhone ([email protected]) and CC to my email address. Both Thunderbird and Outlook display the 66 bytes of text correctly.
    In every case I've seen the number of bytes in the "un-rendered" TEXT/PLAIN has been less than 300 or so. I doubt it's a movie file.

  • Mime type of mx:HTML

    I can use {idHtmlTag.location} when I want to know the URL which is shown in an HTML-field. I searched a while how to find the mim-type of the HTML-field. but without results
    How can I read the mim-type (text/xml or text/html) of the document shown in the HTML-field?

    look to fm WWW_GET_MIME_OBJECT
    and sample program RSDEMO_PICTURE_CONTROL
    A.

Maybe you are looking for