Skip to Content
author's profile photo Former Member
Former Member

Content is not allowed in Prolog error while configuring File to Mail

Hi Expert,

I have a scenario where I have to pick up a file from FTP using sender File adapter and send this file as an attachment using Receiver Mail adapter.

There are 3 requirements :

1) File name of the attachment in the Mail should be same as the File picked from FTP.

2) The Mail content should be "Please find attached the <Filename> for your reference.

i.e The content has to be dynamic

3) Subject of the Mail should be dynamic e.g : Apple_<Filename>

I am facing the following issues :

1. Since single File is picked up,the file is going as an payload and not as an attachment.As a result when i am doing message mapping,i am getting the error saying "Content is not allowed in prolog" in SXMB_MONI or Runtime workbench.

2. Since we have dynamic requirements, i have to Use "Use Mail Package" option.It implies that i have to use Message Mapping.But if i use Message Mapping,i get the error "Content is not allowed in prolog".

I understand that most of the experts would ask me to write UDF's, but if i use UDF i am getting the "Content is not allowed in prolog" error.

Thanks

Saurabh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on May 31, 2011 at 08:31 AM

    Hi,

    Please see the below thread, it might be help to you.

    [Receiver Mail Adapter|Receiver mail Adapter-Need to write a Error content in Mail body;

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2011 at 04:33 PM

    Hi Saurabh

    Try using PayloadSwapBean:

    http://help.sap.com/saphelp_nw70/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm

    http://help.sap.com/saphelp_nw70/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/content.htm

    "Content is not allowed in prolog" could be caused by some encoding issue.

    Regards,

    Giuseppe

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 31, 2011 at 09:15 AM

    Hi,

    >>When i am using sender File adapter (considering i am picking TXT file), is the TXT file converted to XML?

    Yes. It will convert text file to xml file, if you are using Sender File Content Conversion(Sender side).

    If everything goes fine, then you can visible xml file in payload by using the T.code SXMB_MONI.

    Hope this helps.

    Regards,

    P.Rajesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2013 at 02:09 PM

    Hello Saurabh,

    I am not sure if your original problem got solved or not. The following blog helped me to solve the same issue.

    http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/08/16/the-mystery-of-content-is-not-allowed-in-prolog

    Regards,

    Aman

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.