How to send image as a part of body with java mail

How to send image (.GIF) file in mail body & not as an attachement using java mail API

You need to create a multipart/related message.
You'll probably find examples in this forum.

Similar Messages

  • How to send image as a part of message rather than as an attachment

    Dear All,
    I have to configure one scheduler job to send html message containing image.
    I went through couple of posts in the same thread list and I could send email but in all approaches image is being sent as attachment.
    Can somebody guide on how to send within message itself?
    Sample code will help a lot.
    Thanks
    -Ashish

    Dear Billy,
    Thanks for putting in a clear way. I hope now I could understand what you were trying to say. :)
    I generated output in accordance with your format. I also got transferred content printed, still outlook is showing red cross.
    Can you please verify below and let me know what could be wrong?
    MIME-Version: 1.0
    To: [email protected]
    Content-Type: multipart/related; boundary="a1b2c3d4e3f2g1"
    Content-class: urn:content-classes:message
    --a1b2c3d4e3f2g1
    Content-Type: text/html;
    <html>
    <head>
    <title>Test HTML with Embedded Image-chk latest</title>
    </head>
    <body>
    Test HTML with Embedded Image-chk latest
    <p>And here it is:</p>
    <img src=3D"cid:[email protected]">
    <p>The end.</p>
    </body>
    </html>
    --a1b2c3d4e3f2g1
    Content-Type: image/png; name="image001.png"
    Content-Transfer-Encoding: base64
    Content-ID: <[email protected]>
    Content-Description: image001.png
    Content-Location: image001.png
    iVBORw0KGgoAAAANSUhEUgAAAVQAAADsCAMAAAAcoq4rAAADAFBMVEUAAAABmf5/
    nbkZR3vpoZ/VQh/0+f6qoWaKGR56enryohyIq97T4vr35uYGWp7apyCq1P+WnMZz
    grW2cXOVqLyGxv7s6dgdn/VaY3TW2N6UobPw0YE+daK7jR6FZyPir62EnMtYQUSV
    xvaFhYVBqf/sWysEOXn22HwBd8qtHh7Zuobqt7iwo4V4pty0wtbKysr/tVq4wszA
    WlzekFoUYeDkgnu0uMBonc3syTCdjKi3uL0/wP2bFxq5gTFsabjmcGI2SmSSgq7O
    5vOqkJuhut3VoHr0jDf+q1ThZlYmXpjAxoAZgKuPfaXS6f6gYixCk+Cgy/bcySS6
    ODI/q/P2xDztynwIt/9Y0v+1tbUBb8C3nDtXfoTs7vHM2vr97alwHyG6iHpuUgnk
    8f/Nm6DaXE6faSDmmVTllynk5Ob/n3hFyf+mtcv2wDP19PScOzaLr+TRUUbd48br
    hToESIjIOxxCia42fs+wtlW5yvOcnJyHqdyOlKCmvu4kl/2xxfG1l5PD4P7wzCp/
    ibT422YXceC3fVOqs/XauDb59/asrKwCW7b/h1Ziv/yl0/7JRjzMz9T/z3a2KCam
    hpSTlsGaWzJvNChlbn73bTX/lknXd3aMq86Ap+dxeor/3ZmPj4/g3993tOqZqL7K
    iyqr0vYlnNqYksJuXia/a27c4+vaoTqNcTIchMTc6/2LjripPEGsvdOYptO7MSx3
    lK+WtOHikIu02f9Tq/bDxckKUZbpyMnBkH0hSmvCnJV9lciwvc1kdY1vfK774ISL
    kbaapMipsF6Zy/xjQy5Qsv0Vc8O5YDGaeB5SjbCyNRPs8/2mFhfT3eeDGCD6+PaU
    GBz2sRq9jSonapoYtv/M5v//vCfkwoCBnbaEotZ6pOnh6vDa5vv/j0aKgbb7wGPL
    g4GswvD///+ErOZ0qObZk2Ccqti3g3B6j8LDPTasl6zi7PzXZ16qsLuXpNJ2iLtE
    pve6ulGUkYu83P7nxij/dji9vb3kaFq6vcX09/7bSSKywth+h5eiFhgOjrQiAAAA
    AWJLR0TkL2I7KQAAAAlwSFlzAAAOxAAADsQBlSsOGwAADC5JREFUeNrtnQmAHEUV
    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
    RK5CYII=
    a1b2c3d4e3f2g1
    Regards,
    Ashish

  • How to send image file through mail without   any attachment

    Plz tell  me how to send image file through mail without any attachment  ( i mean not converting  that image into pdf or any format )  i want to send that text or image  through mail .

    Hi Sandeep,
    I think you can setup the type of email in Shared office Settings in transaction S016.
    There is an option called <Preset document classes>
    You choose this pushbutton to branch to the maintenance screen for the document classes that are directly displayed to users in the Business Workplace for selection when they use the Create function. The name under which the documents are displayed can also be maintained.
    http://help.sap.com/saphelp_nw70/helpdata/en/6c/69c30f418d11d1896e0000e8322d00/content.htm
    Haven't tried it though.
    Regards,
    Siddhesh

  • How to send images through PI using SOAP adapter

    hi,
    Can anybody tell me how to send images through PI using SOAP adapter.
    Regards ,
    Loveena

    Hi Loveena,
    only as attachments of a SOAP message.
    Regards,
    Udo

  • Some recipients receive my images attached to emails, some find they are embedded and difficult to impossible to separate. Just found out that if I remove my attached signature, the problem goes away. How to send images   signature reliably?

    Some recipients receive my images attached to emails, some find they are embedded and difficult to impossible to separate. Just found out that if I remove my attached signature, the problem goes away. How to send images plus signature reliably?

    When you attach things, make sure to check the box that says [√] Send Windows-Friendly attachments

  • How to  send ALV output data into Excel sheet format via Mail to the user?

    Hi friends,
    I have a doubt ie,
    How to  send ALV output data into Excel sheet format via Mail to the user?
    regards
    Moosa

    Hi,
    Provide the output internal table to the objbin in the below FM
    Send Message
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                document_data              = i_docdata
                put_in_outbox              = c_x
           TABLES
                packing_list               = i_objpack
                object_header              = i_objhead
                contents_bin               = i_objbin
                contents_txt               = i_objtxt
                receivers                  = i_reclist
    and specify the document type
      i_objpack-doc_type   = 'XLS'.
    and try.
    Regards,
    Nandha

  • How to send music from a ipodtouch to another with the bluetooth??

    how to send music from a ipodtouch to another with the bluetooth??

    There is no way you can do that. You should either transfer the music to the phone and play it from there, or you should connect the speaker to the computer itself (provided it is Bluetooth speaker).
    Ericsson T10i -> Nokia 7110 -> Siemens C45, C55, M55, M65 -> Nokia 6131, N73, N82 -> HTC Wildfire, Desire HD -> Nokia Lumia 800 -> HTC Desire X -> Lumia 820 -> Sony Xperia SP -> Lumia 925 + Sennheiser CX 500
    If I've helped, use the Kudos button to thank

  • How to send my security questions and answers to my e-mail?

    how to send my security questions and answers to my e-mail?

    call apple 1-800-694-7466 ask for account security.
    Peace, Clyde

  • How do I mix text and Html format in a java mail?

    How do I mix text and Html format in a java mail? some part I want to keep the text format, the other part I want to use Html functions(like fond, color, etc)

    You don't mix them. Pick one or the other.
    However if you want to have a text version and an HTML version, so that mail readers that don't handle HTML can see regular text instead, then you could produce a "multipart/alternative" message. There's an explanation of how to do that in this article:
    http://www-128.ibm.com/developerworks/java/library/x-xmlist2/

  • How to use a progress bar with java mail?

    Hi, i'm new here.
    I want if someone can recommend me how to show a progress bar with java mail.
    Because, i send a message but the screen freeze, and the progress bar never appear, after the send progress finish.
    Thanks

    So why would the code we post be any different than the code in the tutorial? Why do you think our code would be easier to understand? The tutorial contains explanations about the code.
    Did you download the code and execute it? Did it work? Then customize the code to suit your situation. We can't give you the code because we don't know exactly what you are attempting to do. We don't know how you have changed to demo code so that it no longer works. Its up to you to compare your code with the demo code to see what the difference is.

  • How can I develop co-broswing on Windows platform with java language?

    How can I develop co-broswing on Windows platform with java language?
    The function will be realized
    Now I want to develop a co-broswing system with java language on Windows platform.That is to say I will develop
    a application run on client to track the present browser.Wheh the URL address of your present if changed(for example
    when you click a link or submit a form),the application will capture the new URL address and send it to the other
    client that make co-browsing connect with you.The browser on the other client side will catch the new URL and refesh
    the page to show the page.
    The question I fall across and want to ask you
    (1)How to watch system process with java on the Windows platform?Because I want to get the process information of
    the present broswer,and then get the URL address of the present broswer.
    (2)Develop an application to watch the URL address of the present broswer continuance,If the URL address is changed,
    then send the new URL address to the client on the other side,let his broswer to show the new page using the new URL.

    Paulc, A proxy server is not the right thing.
    What our man here is looking for is a solution for two
    users to kind of surf the net "in tandem" - when one
    user navigates to a different web page, so does the
    other user,
    These are typically used in call center applications
    where the advisor guides a caller through , say
    filling in an insurance form or pointing him to the
    right product specification pages.
    Xing, why are you using Java for this ? You need
    something that has better windows integration. If you
    look on MSDN.microsoft.com and search for "explorer
    bar" you will find solutions to the questions that you
    raised.
    There are also commercial products on the market that
    already do this kind of stuff. there is one from
    www.genesyslabs.com which is considered to be the best
    of breed.
    It is difficult or almost impossible to do this in
    Java for a commercial application.
    If you are developing this as an academic exercise,
    give it a try. Post your email address here, and I
    will contact and help you out if you like.my e-mail is below ,I want to contact you and need all of your help.
    [email protected]

  • Coding to send mail but body with java script

    Hi,
    here my requirement is send mail in action but body with java script just tell me how i include java script in coding of mail sending.
    regards,
    ss

    self

  • How to send image converted to string to remote pc over tcp/ip

    hi,
              I have couple of questions. I have captured images on firewire cameras through CVS 1456. To send them on host PC i have converted an image to string. Now
    1.  How to send the image  converted to string to Host PC via TCP/IP? Please give some example.
    2.  How to converted these recived strings back to image if  iwant to proess them.
    thanks in advance.
    regards,
    yashpal

    Hi MikeS81 
    i am Prabhu.G from chennai(india). i saw your attached picture. after
    traing this image send through TCP/IP program. but sum errors in
    receiving part. so please check it this one.  i attached this VI &
    (error)picture. please send me the solution of this.
    my mail id:[email protected]  
    Attachments:
    imag send tcp.PNG ‏79 KB
    image tcp.vi ‏30 KB

  • How to send images using Tuxedo 6.5

    What would be the best way to send images( bmp, jpeg, gif) using Tuxedo 6.5? Ideally,
    I would like to keep the image with the data, ie., have the image as a field in
    the FML32 buffer. I can't see anyway of doing this... Create a new buffer type??
    Thanks
    Rich

    Rich,
    How about storing the binary image in an FML field of type CARRAY?
    Be aware of the performance impact of very large buffers - >75% of MSGMNB (I
    think) and they're transferred by file i/o -
    Regards,
    Peter.
    Rich Wojcik wrote:
    What would be the best way to send images( bmp, jpeg, gif) using Tuxedo 6.5? Ideally,
    I would like to keep the image with the data, ie., have the image as a field in
    the FML32 buffer. I can't see anyway of doing this... Create a new buffer type??
    Thanks
    Rich

  • How to send images using SOAP adapter

    hi All,
    I want to send images using the SOAP adapter . ( Sender and Receiver )
    Can anybody help out with this requirement
    Regards,
    Loveena

    Hi,
    Following links may help U
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/29/5bd93f130f9215e10000000a155106/frameset.htm
    to know the basics about soap adapter u cn check out this link
    /people/padmankumar.sahoo/blog/2005/02/15/an-overview-of-soap
    to get in detail about the attachments chk out this link
    hi i am unable to attach an attachment in File to mail scenario
    Regards
    Pullarao

Maybe you are looking for

  • Question about using multiple iPods on the same PC

    I've read the FAQs on this subject but I still have a couple of questions about multiple users with separate iPods using the same PC. I want to use my family's desktop (A new Gateway with Vista, if it matters) for my new iPod Classic, but my father a

  • Any tutorials on how to make or edit tetxure images for 3d modeling?

    wondering if anybody knew where some tutorials are on this. when I crop an image say for an example a plank image even though the result ion is over 1k it still looks unclear. see how the one furniture image (2048 x 2048 ) looks clear compared to a c

  • Wildcards in gateway URL prefixes?

    Hello, We are using a proxying utility called EzProxy from Useful Utilities for controlling student access to online databases and catalogs, which use client-IP as it's security mechanism (basically if the requests come from our network it lets the c

  • Set mpeg resolution to less than half?

    Is there any way of setting the mpeg resolution to less than half? I ask this because I want to use the program strictly for HDV real time monitoring (not recording) and it seems like the latency is most affected by the mpeg resolution.

  • Making proyector adds a duplicate cast to my movie

    Probably this is a known issue but I havent found a solution although I have searched the forum (normally that works wonders). I have a project (desktop with multiplayer features but not shockwave) being developped under Director 11.5. When I publish