Receive mail body content

I have problem with receive mail.
IOException "no content".
My code:
Folder folder = store.getFolder("INBOX");
folder.open(javax.mail.Folder.READ_ONLY);
Message[] message = folder.getMessages();
for (int i =0; i< message.length; i++) {
Part messagePart=message;
Object content=messagePart.getContent();
if (content instanceof Multipart)
messagePart=((Multipart)content).getBodyPart(0);
System.out.println("[ Multipart Message ]");
String contentType=messagePart.getContentType();
System.out.println("CONTENT:"+contentType);
if (contentType.startsWith("text/plain")
|| contentType.startsWith("text/html"))
InputStream is = messagePart.getInputStream();
BufferedReader reader
=new BufferedReader(new InputStreamReader(is));
String thisLine=reader.readLine();
while (thisLine!=null) // <<---- IOEXCEPTION "NO CONTENT"
System.out.println(thisLine);
thisLine=reader.readLine();
any ideas?
thanks.

Try this first .... Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
Or quit the mail app and restart. Go to the home screen first by tapping the home button. Double tap the home button and the task bar will appear with all of your recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button.
Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
Can't speak about contents and attachments with mail in the cloud as I have no use for it and therefore do not use that iCloud feature.

Similar Messages

  • E-Mail body content appears in single line as a string.

    Could someone advise the way to format(space, new line, bold etc) E-Mail body content in BPEL.
    I wanted an email body content be sent as following:
    Hi,
    This is my test email through BPEL.
    Well Done!
    Cheers
    R
    But when it actually sent, it just appeared as continuous string as follows:
    Hi, This is my test email through BPEL. Well Done! Cheers R
    Thanks
    T

    I tried a workaround and used html tags in the email body in BPEL, as follows:
    <%string('<html>
    <body>
    Hi, <used line break wherever required ie. br>
    This is my test email through BPEL.<br>
    Well Done!<br><br>
    Cheers<br>
    R
    </body>
    </html>')%>
    It worked fine as expected. Still, with plain text, it appears as single straight line. I welcome comments on this!
    cheers
    thobula

  • ERMS Mail Body Content

    Hello.
    During  ERMS processing I need to accept mail body content for future processing.
    How in method IF_CRM_ERMS_SERVICE~EXECUTE of class CL_CRM_ERMS_AH_CREATE_IR could see mail body as string?
    Thank you.
    Igor Spector

    Hi Igor,
    I believe you have the answer in variable lr_sc_mail_data of that method. After instatiated (around line 167), you just have to read table lr_sc_mail_data->body and get the entry that as content_ascii filled.
    Can you check if that is working in your scenario?
    Kind regards,
    Garcia

  • Receiver Mail adapter Content type issue

    Hello,
    I am formatting the body of the receiver mail. The body of the email  should look like below.
    Dear PI User,
    The following Interface has been successfully processed by the middleware PI system.
    Please do not reply to this email. If you need more information please contact the Super User.
    Regards,
    SAP PI Team
    The mapping looks fine and My source MT looks like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:MT_Mail_Reply xmlns:ns1="http://test.com/Mail/Reply"> 
    - <Reply>  [0..unbounded] 
    - <Item> [0..unbounded] 
    <MESSAGE>Dear Business User, </MESSAGE>   [0..1] 
    /Item>
    - <Item> 
    <MESSAGE>The following Interface has been successfully processed by the middleware PI system.</MESSAGE> [0..1]
    </Item>
    - <Item> 
    <MESSAGE>Please do not reply to this email. If you need more information please contact the Super User.</MESSAGE> [0..1]
    </Item>
    - <Item>
    <MESSAGE>Regards,</MESSAGE> [0..1] 
    </Item>
    - <Item>
    <MESSAGE>SAP PI Team </MESSAGE>  [0..1]
    </Item>
    </Reply>
    </ns1:MT_Mail_Reply>
    The mapping works fine without errors and I get the target message as below after mapping-
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30"> 
    <Subject>ISAP PI Interface Status</Subject> 
    <From>[email protected]</From> 
    <To>[email protected]</To> 
    <Content>Dear Business User</Content> 
    <Content>The following Interface has been successfully processed by the middleware PI system.</Content> 
    <Content>Please do not reply to this email. If you need more information please contact the Super User</Content>
      <Content>Regards,</Content>
      <Content>SAP PI Team</Content>
    </ns1:Mail>
    t
    The context of MESSAGE has been changed to Reply.
    In the adapter I still get the following error.       
    Delivery of the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.sdk.xi.srt.BubbleException: Failed to call the endpoint  [null "null"]; nested exception caused by: com.sap.aii.af.sdk.xi.util.XMLScanException: expecting end tag: {http://sap.com/xi/XI/Mail/30}Mail, but found {}Content at state 1
    Please advise !!
    Thanks,
    Teresa
    **I changed the receiver mail adapter to not use Mail package and I receive an email without errors with the Content as mentioned above. **

    Hi Teresa,
    I think the problem is that you are using multiple "Content" tags. Have you tried to use only one?, you can concatenate all your text.
    Check the page 3 of this document to know how introduce new-line character http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0964d7c-e66e-2910-24bb-ac535e4a5992?overridelayout=t…
    Regards.

  • Mail Body Content

    Hi,
    When we try to send mail, the body content is included as an attachment as 'Notification1.html' (which is a default one) Instead we need to have the mail content in the main body.
    What changes do we need to achieve this?
    Regards,
    Saranath

    hi,
    If anybody face the same problem like mail body as attachment then go for the bellow solution.
    Check your settings in TCODE SCOT
    Double click on SMTP note . For "Internet" click on set, under "Output format for SAP documents" RAW Text musts be set as "TXT"
    Regards
    padmaja.

  • Receiver Mail Adapter content conversion

    Hi
    I have read a lot of forums, etc and changed much on my adapter, but still get a xml file send as an attachment instead of a text file.
    Can anyone please advise on how to change the receiver adapter to covert from xml to text.
    I have added the module processing sequence like follow - please help.
    Processing sequence
    localejbs/AF_Modules/MessageTransformBean  Local Enterprise Bean XML2Plain
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean Mail
    Module configuration
    XML2Plain Details.endSeparator                               'nl'
    XML2Plain Details.fieldName                               ZINDUS,TCODE,TDATE,RDATE
    XML2Plain Details.fieldSeparator                          |
    XML2Plain Transform.Class com.sap.aii.messaging.adapter.Conversion      xml/txt
    XML2Plain Transform.ContentDisposition                          attachment;filename="TEBA.txt"
    XML2Plain Transform.ContentType                          xml/plain
    XML2Plain xTransform.recordsetStructure                     Details
    Thanks
    Clinton

    Hi,
    From the mail adapter FAQ,
    <i>How can I set the file name of a mail attachment?
               There are several MIME headers that play a role in how the client retrieves the file name of an attachment. Unfortunately, this behavior differs among various mail clients. The reason for this inconsistent behavior comes from the fact that this mechanism has been extended incrementally. The old way is to use the name parameter in the Content-Type header as specified in RFC1341. For example, you can set the content type of an XML attachment as:
               Content-Type: application/xml; name="abc.xml"
               RFC1521 discourages the use of this name parameter in anticipation of the new header Content-Disposition, which is defined in RFC1806.
               With this Content-Disposition header, you can set the file name as:
               Content-Disposition: attachment; filename="abc.xml"
               Some clients may show the Content-Description value as the file name. The Content-Description header is typically used to associate some descriptive information to an attachment (RFC1341) as in
               Content-Description: my xml file
               To avoid potential interpretation problems, it is recommended to combine the use of these headers.</i>
    Also, the note 779981 describes how to set Content Type in the mapping program. Am not sure, but combining the two, maybe it should be possible! Havent tried something of this sort though!
    Regards
    Bhavesh

  • How to change content-type in receiver mail adapter

    Hi,
    I have receiver mail adapter for sending XML file as attachment in the mail. My partner expects to receive mail with content-type: text/xml, but XI sends Content-Type: application/xml. Please advise how I can change content-type to text/xml.
    Thank you
    Lev

    hi,
    try MessageTransformBean
    Transform.ContentType
    http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm
    also shown in my blog:
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Receiver Mail with image

    hello all,
    i have a scenario FILE -> MAIL.
    I would like to know if it exist a module or other option enable me to create in the receiver mail body a nice presentation with image or logo ?
    or do i need it to develop it ?
    Thanks,
    Jean-Philippe

    Hi,
    Yes that is possible with PayloadSwapBean adapter module.Look into the below link for more information.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816?quicklink=index&overridelayout=true
    Regards,
    Yuga

  • Excel file(.xls) as attachment and Body(Signature) via Receiver Mail Adapter

    Hi PI Experts,
    I have a requirement File(.txt) - PI(7.4) - mail (.xls attachment and signature in the body). Can anyone pls help me with the best approach to send excel file as mail attachment and signature in the body.
    Thanks,
    Sri

    Hi
    You can try this approach
    1. use mail package and java mapping to populate the mail package.
    inside the java mapping do the following
    a. read the text file and convert it to excel and then set it as additional attachment.
    b. map the signature and body with the field 'content' of mail package.
    2. on the receiver mail adapter check both mail package and keep attachment options.
    Hopefully this will work.
    Reference links
    excel write : Excel and Java - Read and Write Excel with Java - Tutorial
    set attachment: How to save MainDocument as additonal attachment in sender channel?

  • How to get the content of message in the mail body

    Hi,
    Can anyone suggest me to get the message content as the mail body using messagetTransformation bean????

    Hi
    In the Receiver Mail Adapter use these settings
    Message Protocol:XIPAYLOAD
    and tick on Use mail package.
    Gt back if you have more doubts
    Thanks

  • File to Mail with body content and attachment

    Hi Experts,
    Here my scenario;
    I receive an xml file, this xml file content need to be mapped to body of the eMail as well formatted email. and also the original xml file which I receive need to be sent as attachment.
    I searched in sdn, help and checked many blogs..
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
    /people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
    If I want to send email with message in body then I need to select message protocol XIPAYLOAD and use mail package, but Iam not able to send the original file as attachment.
    How could I achieve both??
    please help.
    If not clear please let me know, I will explain in detail.
    rgds
    skr

    Hi SKR,
    Check the below blogs, this will throw some light on your issue.
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    /people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
    Thanks,

  • Unable to get source file content as mail body in file to mail scenario

    Hi Friends,
    I am facing one problem with one of my file to mail scenario in PI(SP9).  I have done bypass scenario(without IR only with ID objects). Scenario is working fine, i am getting mail also.  But my requirement is i want complete source file content as a mail body (not xml format, text format).  I have checked all options, but configured scenario bydefault taking source content as a attachment and mail body is empty.  I have tested below options
    1. If i choose message protocol as FCC mechanism at source side content at target side i am getting xml format as a attachment( In mail adapter i have selected message protocol as xi payload, and without packate option on mail adapter). If i choose message protocol as xi all, i am getting 2 files as a attachment (one file as a payload content and second file as a source file content in xml format).
    2. If i choose message protocol as file at souce side that time i am getting source complete content as a attachment at target side in xml format, but mail attached file content is flat file(.xml extension) format. When i tried to open attachment file that time i am getting error in explorer, but i can see only one row in explorer  remaining rows unable to see.
    Please share your ideas on this.

    Hi,
    Follow below steps
    1. First basis level need to configure setup(SMTP) for mail.  After that only mail will go from SAP.
    2. Source side depending on requirement take communication channel(idoc, file etc)
    3. Receiver side communication channel take mail adapter and configure below setup
       3.1 select message protocol XI ALL/ XI PAYLOAD(WITH PACKAGE or WITHOUT PACKAGE)
       3.2 if message protocol is XI ALL, the complete content will be sent as a attachment along with payload file
       3.3 if message protocol is XI PAYLOAD, the source message, the source message will be sent as attachment.  Playload file filter automatically.
       3.4 If you use PACKAGE option on mail adaper, this time source strucute need to import from SAP (some standard structure only will be support, without strucutre we can't work).  If you choose package option no need to give mail id on communication channel, we need to pass mail id's from source structure.
    I hope now clear.

  • Receiver Mail Adapter - Mail body as attachment

    Hello friends,
    I have scenario = File -> XI  -> Mail
    The scenario is working but the problem is body of the email is coming as attachment in the mail client.(outlook express)
    Is there any way to avoid the body coming as attachment.
    Regards
    Ramesh P

    Hi Ramesh,
    You can use the MessageTransformBean in the receiver mail adapter for this.
    Refer this for the parameters which you can use
    http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm
    Regards,
    Chandra

  • Swapping attachment to content on Receiver Mail Adapter

    Hi Experts,
    Can I move my attachment data to content on receiver mail adapter ? I am not using Mail package or mapping. I tried using Payloadswapbean on receiver adapter but adapter generated email with attachment only with and without Payload swap bean module.
    Please let me know if it is possible without using Mail Package.
    Thanks,
    Ankit

    Hi there,
    If you want to use attachment in content, then you need to collect the entire mail content in BPM. From there you can use Payloadswap bean on receiver adapter.
    The reason behind using BPM is that the attachment is maintained only in Integration Directory. First the mapping converts the source into mail and then just before moving to receiver the attachment gets added to the mail(i.e. after mapping). So if a BPM is used then all the mail content with attachment will get transported to BPM first and then to the receiver with the above change (Payloadswap bean i.e transferring the attachment to content).
    Best Regards,
    Souvik

  • Mail with HTML BODY content?

    Hi,
    We seem to have a little problem with sending mails wtih HTML content, we have a "Link" in the mail body to be sent , so we are using html tags <a href=""link"></a> so that the mail receipient see the URL as a link ....
    The actual code used is given below:-
    l_body_html := ' <html>
    <body>
    <p>Hi,<br><br>You have been provided access to <a href="http://URL.com:20000/pls/htmldb/f?p=102"></a>'||
    '</p> </body> </html>'
    HTMLDB_MAIL.SEND(
    P_TO => '[email protected]',
    P_FROM => '[email protected]',
    P_BODY => l_body_html,
    P_BODY_HTML => l_body_html,
    P_SUBJ => 'Access Details.');
    What is wrong here , except the link of URL the rest of the text is coming in the mail body...
    regards
    Naveen

    Naveen,
    This is an HTML problem. You have provided no text for the anchor.
    You probably want something like:
    &lt;a href=http://URL.com:20000/pls/htmldb/f?p=102>Click Here&lt;/a>
    And to be proper HTML, you should enclose the href value in double quotes, as in:
    &lt;a href="http://URL.com:20000/pls/htmldb/f?p=102">Click Here&lt;/a>
    Joel

Maybe you are looking for