Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    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 comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded

  • 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 comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    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 comment
    10|10000 characters needed characters exceeded