Embedding image to the email sent through JavaMail

The code below attaches the gif to the email.
does anyone know how to embed it?
MimeBodyPart mbp2 = new MimeBodyPart();
FileDataSource fds = new FileDataSource("TheFuture.gif");
mbp2.setFileName(fds.getName());
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setHeader("Content-ID","<23abc@pc27>");
mp.addBodyPart(mbp2);
msg.setContent(mp);

http://java.sun.com/developer/onlineTraining/JavaMail/contents.html#IncludingImagesWithHTML(Warning: the forum software is going to embed some blanks into that link for your improved forum experience. You'll have to edit them out before you can follow the link properly.)

Similar Messages

  • Can we fetch a report which shows the information carrying the emails sent and received by exchange servers?

    Can we fetch a report through scom 2007 r2 which shows the information carrying the emails sent and received  by exchange servers?

    Hi,
    Within the imported Exchange management pack, we have some default reports that could be run. Have your imported the proper MP to your management group, please check whether those default reports can achieve what you want.
    In addition, here is a powershell script to show total number of emails sent and received per user:
    Exchange 2007/2010 Email stats
    https://gallery.technet.microsoft.com/scriptcenter/bb94b422-eb9e-4c53-a454-f7da6ddfb5d6
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • The email sent from macbook do not appear in my iphone and yahoo account

    the email sent from macbook do not appear in my iphone and yahoo account

    thanks for your help... I was feeling frustrated because the sync problem, but with your suggestion all contacts are now on my iPhone. _Thanks once again_.
    I think that I was asking two different questions at the same time, because the problem with the iPhone synchronization was solved, but the .Mac Address Book still has no new contacts... just the contacts before the Mac OS X update to Leopard. I guess that I will need to look for help in other discussion topic.

  • I am trying to create an itunes account.  There doesn't seem to be a link to click 'I agree' to the terms and conditions on the email sent to me.  Can anyone help?  Thanks.

    I am trying to create an itunes account on an ipad mini IOS 8.1.  There doesn't seem to be a link to click 'I agree' to the terms and conditions on the email sent to me.  Can anyone help?  Thanks.

    Create a NEW account/ID for her using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before. Make sure you specify a birthdate that results in being at least 13 years old
      Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    More details of how:
    http://ipadhelp.com/ipad-help-tips-tricks/how-to-get-free-apps-from-the-app-stor e-without-a-credit-card/

  • My iphone is stolen,but the email sent back didnt sent location of the iphone,would u please to check it for me.thanks

    My iphone is stolen,but the email sent back didnt sent location of the iphone,would u please to check it for me.thanks

    Just so you understand, this is not Apple.  This is a user to user support forum.  If you wish to contact Apple, you can do so here.
    You can enable Lost Mode for the lost/stolen iPhone to access a array of features.  If the iPhone is locatable when it is connected to the internet, then a location will appear on icloud.com/#find.  For more information, visit here or contact Apple.

  • I cannot get the email sent to me back on the ipad once I have read it How do i find it again?

    I cannot get the email sent to me back in the mail section of my ipad once I have read it How do i find it again? and when i press accounts and the "SENT" buttonI don'y gat the emails sent too me?

    The "Sent" mailbox is for emails YOU have sent to someone else.
    Tap the buttons at the top of the mail list until you return to the Mailbox list, then tap All Inboxes or the Accocunt name.

  • TS3899 How can I see again the emails sent from my MacBook Pro on my iPhone 4?

    Hi. I have a iPhone 4 connected to a Yahoo email account. I used to be able to see the emails sent from the device on the sent mailbox and the emails sent from the MacBook Pro on an automatically created folder called "Sent Messages" that disappeared. I tried deleting the account and creating it again, both on the computer and on the iPhone, but the problem persists. Any idea on how I can solve this problem?

    On your Mac
    in your Mail App, open the folders on the left hand side, by clicking SHOW on top.
    GO down, where your email acount is and unfold.
    Select the SENT folder. If you cant find it, it means it's already used as your SENT folder. Skip next step.
    In Mail App Menu select MAILBOX -> USE THIS MAILBOX FOR -> SENT
    Maybe that does the trick?

  • Why the emails sent from MacBook Pro are so wretched?

    Really need help, guys..
    Why all the emails sent from my Macbook Pro (from Mail and even from website of yahoo mail and gmail), people received it so mussy...so wretched (am not sure the correct word in english)..
    People received it without paragraph at all. Although I typed emails with 3 paragraph, turned out people got it in 1 paragraph.
    Can somebody tell me what's wrong?

    Nothing is wrong on your end. The problem is the way they have set up their email program to display their emails.

  • HT4436 I accidently deleted the email sent by apple to verify my icloud

    I accidently deleted the email sent by apple to verify my icloud account.  Now i have been into the icloud and unable to use it as the account is unverified?

    Go to appleid.apple.com and sign into "manage your apple id".  You'll see your email address and a button you can click to resend the verification email.

  • Emails sent through Mail 7.0 on Mac won't appear in the Sent folder in the Yahoo web browser or the Mail app for iPad.

    It seems that emails I send via Mail on my mac are stored only in Mail's Sent folder. These emails don't appear in the sent folder of Yahoo web browser, iPad Mail app, or the Y! Mail android app..
    I've tested to see whether my emails are actually sending properly, and they are. I just want to know why the Sent messages on my mac aren't appearing anywhere else. I've read similar issues to this but haven't yet found a reason or solution.
    Thanks in advance

    [edit] I dragged the email I sent through the MBP Mail app (under MAILBOXES > Sent > Yahoo!) to the highlighted Sent folder (YAHOO! > Sent), and now it shows up on all Yahoo Sent folders (iPad app, web browser, phone app). Not entirely solved the issue but will use web browser to sent future emails to keep everything in sync.

  • Aperture Email Attachments are Embedded in the Email Sent to Windows PC's

    I've searched the forum and have run across this problem discussed previously.  When sharing photos from Aperture 3.4.3 using the Email preset, the jpg's show up embedded in the body of the email when sent to people using PC's and running Outlook.  Oftentimes, the jpgs actually appear as thumbnails as well, and not full size.  I've tried the suggestions found here in this forum without any success.  In Mail, I have "windows friendly attachments" checked, although that particular menu item is greyed out, and can't either be selected or de-selected.  I've also formatted the email as "Plain Text".  Still photos attached don't show up on the Windows PC's as attachments.  I even exported a photo from Aperture to my desktop, then attached that jpg to an email, and got the same results.  I'm not sure if this is an Aperture problem, or a Mail problem.  I'm using Aperture 3.4.3 and OS 10.7 .  Am I missing something?  Thanks in advance.

    Hi,
    I have experimented extensively with this issue.  It is related to the recipitants email app, but in previous versions of Mail could be made successful by clicking on Format/Make Plain Text prior to sending.  In Mail in Lion and ML, this change does not stick, and the message utlimately gets sent in Rich Text/HTML which is why the MS apps have problems.
    The Make Plain Text strangely enough endures if you add a Signature following the attachments that is EMPTY but composed as text only plain text.  This 'tricks" Mail and OSX to not change it back.  I cooresponded with Apple engineering about this, and they say the use of Rich Text is necessary and helpful with Exchange Accounts.  But this does not help the many who are not in Exchange Account Situations.
    See:
    https://discussions.apple.com/message/17550705#17550705
    The use of Attachment Tamer in general can help this, but I don't use it, and it is not clear to me how it would work when invoking Mail sending from within Aperture (or iPhoto which suffers the same issue).
    MS could probably solve the problem, but at last check even RTF produced in Outlook could be problematic to those using Outlook Express, or vice-versa.
    Ernie

  • What controls whether embedded images scale to email window size?

    When I create a new Mail.app msg and insert or drag/drop an image inline, it visually scales to fit the size of my msg window, which is about 60% of my screen width. (I'm not talking about altering the physical size of the image)
    However, when I look at the msg from the sent folder or from a copy sent to myself, it appears fullsize, and this causes the msg text to now have a line length equal to the width of the embedded image. So now I have to scroll sideways to read the msg/view the image, or open the note to the size of the image, which I don't want to do. I want the computer to adapt to me, not the other way around.
    I'm pretty sure that this used to function as I desire. To further rub it in, I got a msg from a relative today, sent from his peecee using DarkSideSoftware, and those images scale to my msg size. What's the deal?
    iMac G5 2GHz Mac OS X (10.4.8)

    hi, in prefs, Composing: Message Format: Rich Text
    The only contextual menu choices are Download Image and Copy Image. However, if I check an image that scales properly in the email I mentioned, the resulting menu includes:
    Open Attachment
    Open With
    Save Attachment
    Save to Downloads Folder
    View as Icon
    I also notice that 1 sec after hovering over the image in the "good" note, I get a popup for a few seconds indicating the image name, status, mime-type but hovering over the image in the other note produces no result.
    I thought it might have something to do with send/recv via .mac (imap) VS the "good" note came via another of my pop accts, but testing shows the same results.
    For grins, I blew the dust off Entourage 2004 and let it go get about 200 mail msgs, and the "good" note acts exactly the same, that is the images all scale to window size. The last note I sent via Mail with a 1920x1200 img and downloaded into Entourage displays inline --> smaller <-- than the note window size... It appears Entourage in general wants to scale to 50% of whatever the window size is moved to.
    Ok, I took the "good" note which was scaling correctly and used Mail.app to fwd it to my .mac acct and when I download it with Mail.app the images no longer scale, but now show fullsize. Same note functions as before/correctly in Entourage.

  • I have been really messed up and defrauded by your employee. I have the email proof through this site, besides witness's.

    I have a record of my email and post regarding my problems with Internet Explorer 11, with my Windows 7, not working and connecting to other sites not nearly working as well as Int. Explorer 10. I was just told by support since I didn't have a case number,
    I had no proof. My email account in Microsoft is the same as with Verizon. So, I have proof on this site. Now, after I posted my complaint reg. Int. 11 not working nearly as well with my Windows 7. An employee from Microsoft took control of my computer for
    the 2nd time without notice. I was SO VERY clear about wanting to go back from Int.Ex. 11 to Int.Ex.10. An employee actually restored by computer without me asking from 10 back to 11, after I had some issues with hackers. As stated in my emails to you, Int.
    Exp. 11 never seemed to be very compatible in working with the add-ons and communicating to other sites. The guy who took over my laptop without permission, I thought was helping, ignored everything I asked for. I worked through the night and for about 10
    hours with him. I had to make 16 backup/restore disks, per him doing all the actions through Homegroup. I didn't even know u could take over my computer controls without permission. He made changes after changes, while I mostly kept my hands off the keys throughout
    the night and the day yest. I was just putting in disk after disk when it would pop out and he had the notice keep popping up, when he wanted me to change disks. I have not slept or ate for two days, cuz I kept working through hardcore stress. I didn't even
    follow what changes he was making cuz it was going to fast with things popping up everywhere. I would just have to ender Adminstrator ID and enter a few items. I did not make an alteration, cuz I did not want to mess it up. He completely ignored my email/post
    about consistently wanting to go from Int. Exp. 11 back to 10. I was so ill and tired, that I could barely keep up. After working with him, by just inserting disks mostly, I sent an email at the end to Microsoft saying that I don't think his repairs would
    work. This due to many issues, but mainly still not getting the add-ons for my different drivers. I had Google Chrome, Bing and the Int. Exp. 11 I wanted reversed, cuz he still could not get all the add-ons to work, with red checks over them and saying disabled,
    as long with other issues. I just kept having to put in my Adminstrator  passwords and he used my guest access as well, which I never use. I was so frustrated. NOT NEARLY AS UPSET AS A FEW-FIVE HOURS AGO, when I found it was worse than ever and the main
    thing I complained about and asked for, Int. 11 going back to 10, did not happen at all. There was just Int. Exp. 11 and he even took off my Google Chrome. I had no idea that my computer could also look different with different users. Icons being larger and
    in different places. It upset me horribly because I am ill cuz the stress I have been under and have not even ate since this began. I have proof via emails and also spent 10 hours following his lead. I had no idea, when I turned my laptop back on, it was NOT
    ONLY NOT WORKING CORRECTLY, BUT HE KEPT Int. Exp. 11 and never made the change. There were so many pages up, I could not see what he was doing. It took me 16 disks to just copy all the stuff in the drive. I also used tried to use the small cards, when the
    disks went way too fast. Now, my laptop is worse than even, with things saved all over my files, where I have no idea of what is what. He typed in the names to these backup files and I was too sick to keep up at all. I was so exhausted and sick at the end,
    I was just glad he was done. Like I said, I sent an email while he was still working on the issues, to you saying that it does not look good at all and would probably not work. He closed the approx. 20 windows that were open quickly, when the last disk backed
    up all the changes. I was feeling so horrible, I  had to just shut the laptop off and pray. Then, after resting for hours, I turn it on to find NO Int. Exp. 10 and still Int. Exp. 10. Many of the add-ons issues and a bunch of other things were worse than
    even. I called in for help, he was pretty rude, cuz I was/am exhausted, sick & upset. My laptop is arranged differently and also does not function correctly. I could have just uninstalled 11 and installed 10, like I asked about in my email. My files even
    said Int. Exp. 11 going to Int. Exp. 10. He ignored me and also left my computer way worse in other ways, with software uninstalled and items rearranged.  The guy who I spoke to a little while ago said I had no proof I even worked with him. Not only do
    I have records of what was sent, I had people swing by and they saw what was going on. I was complaining to them how exhausted/sick I felt for being up so long w/o food, while feeling helpless. The guy I just spoke with gave me case #1278021415. My email sent
    you guys while he still controlled my computer is through Microsoft. So, I am certainly not some crazy guy. I actually have been able to fix issues by hackers, etc., worse than this before. Now, my computer is way jacked, I need to work in a bit, and am so
    sick over this. Plus, I will probably have to hire someone to reverse all this horrible damage done. I cant believe even the computer looked different under my Admin. name & guest name. So many issues that I did not have and he did not even listen to what
    I wanted to change. I could have swithed 11 to 10, but I wanted to know the effect it would have on Windows 7 and docs, if any? I believe he worked on it so long, cuz he felt bad for going into my laptop the day before, without any notice, and restoring my
    computer back from Int. Exp. 10 back to 11. He was trying to help, but I did not even ask for any at that time. Now, my computer is jacked, I don't really trust all the backups disk/files, cuz so many. I could tell he knew what was saved where though. He did
    it all. I just was assisting, watching and trying to keep up with copying the info and putting in disks. Now, I am stuck with a messed up laptop and your tech wanted money from me, after your guy messed up my laptop bad, crazy things changed in 2 different
    settings/names and I have been not able to eat or sleep now for two days cuz of this. Then, your guy questioned if I was telling the truth. I have lots of property and am successful. I just didn't feel I should pay a company for unauthorizingly changing and
    breaking my stuff, while making me stressed and ill. I have 2-3 techs that handle issues, if I don't feel like dealing with them, but I actually know what to do on computers pretty well when not sick and rushed. I am no tech, but certainly no idiot. Its not
    hard to see things were not going well with red warnings all over the place and saying add-ons were disabled with big red marks over them. I am sure your tech knew, that is why he closed it so fast. Why did he not even try to change what I asked in my email??
    He completely ignored me and now I am ill and have a laptop way worse. Suppose to do some work in a bit, but I am so exhausted, hungry and back issues from all this typing leaning over (had X-rays a few weeks ago). I don't know what to do at this point off
    exhaustion and also being questioned if I was making it up or something. I have witnesses and the email. My headed on email that I sent through Microsoft is I want to go from Int. Exp. 11 to Int. Expl. 10, cuz the add-ons don't work as well and I get booted
    way more easily, or cant even reach other sites. I know it can be restored again, but it had issues before that I spend time and money fixing. I feel take advantage off and now blackmailed cuz your employee insisted that I pay for him just looking at the mess,
    your other employee created. Just makes me more sick. I could trust Int. Exp. 11 to work and now I feel no trust and much deception by your company. I will probably be sick for days and I know my back is out again and I am cramping cuz no food and ALL stress.
    I had an employee over watching me deal with all this happening, not friends, etc..  I saw he was using Homegroup and took down a few things. I knew it wasn't going well, but was in no shape to argue. Are you guys doing to do anything about this, or put
    the blame on me for trusting your employees. I just asked a couple questions and complained. I never said anything about hacking into my computer and messing my life up. This just is not right at all. A laptop is a pretty cheap fix for me, but I did just pay
    a guy over $200 to get things working well again cuz of hackers utilizing all the negative aspects about going onto some sites. I cant believe this happened. I cant believe this came from a large company, which I thought I could trust. Again, I have the email
    I sent while he was stick backing up the changes. It took hours, literally for all those darn disks. What will you guys do about this, cuz I am too sick to do anything for a bit. I was in the hospital just a couple weeks ago, cuz of stress and issues of this
    sort. Its so wrong!!  I want to give my info on here, but I am sure you will have it. The guy even said I didn't need to put my email address, I believe, or was it name, but I put it on my email sent anyway. I never lie!!  I look forward to your
    response, C. York   Also, the email address I use is for Verizon and I would prefer if u just sent it there or both places. I don't even want to look at this thing for a while, but my anxiety over this will probably force me to. I wish I could put
    in a phone number. Maybe I can somewhere, cuz I would like to know what you are thinking about all this. I know I got wronged, but I wish I knew who exactly. Like in my 2 email, while he was working, I saw "Hagan", I believe in response to a first
    post. I responded and asked question after reading it. I noticed when I went to post in public a bit ago, that I had never done that before. Just sent email direct, especially the 2nd, in which I have confirmation from your company. Again, last guy gave me
    case #1278021415. I thought I could trust your employee, so I did not get a bunch of info from him. I hope u know who was working on it, since he was when I emailed you. If you don't get my info somehow, please email me here, so we can communicate. I might
    post this a few places or keep it to post. I am so upset and shocked. Thank you!  C. York  

    What I wound up doing was installing the newest of the newest versions of firefox (it's at 5.0 or something now, I think). That just made all the plugins, add-ons, and extensions I wanted to get rid of obsolete and it auto-removed them on its own.
    I do really appreciate you taking the time out to try and offer some solutions though. Thank you very much for your effort!

  • Php form not including a field in the email sent to me

    I have tried to add a phone field to an existing form on my site, I just duplicated the existing email field and changed to say phone instead. The form works fine except that the  email that comes through to me has all entered data from the form except for the phone field. Help would be great as I am a bit of a newbie.
    Here is the mail.php:
    <?php
        $name = $_REQUEST['name'] ;
        $email = $_REQUEST['email'] ;
        $phone = $_REQUEST['phone'] ;
        $comments = $_REQUEST['comments'] ;
        $message =
            Name: $name\n
            Email: $email\n
            Phone: $phone\n   
            Comments: $comments
        mail( "removedforprivacy", "Email from my website, sent by $name",
         $message, "From: $email"  );
    ?>
    Here is the form HTML:
    <form method="post">
                            <fieldset>
                                <ol>
                                    <li>
                                        <label for="name" id="name_label">Name</label>
                                        <input id="name" type="" value="Your Name" name="name" class="text-input" />
                                        <label class="error" for="name" id="name_error">This field is required.</label>
                                    </li>
                                    <li>
                                        <label for="email" id="email_label">Email</label>
                                        <input id="email" type="" value="Your Email" name="email" class="text-input" />
                                        <label class="error" for="email" id="email_error">This field is required.</label>
                                    </li>
        <li>
                                        <label for="phone" id="phone_label">Phone</label>
                                        <input id="phone" type="" value="Your Phone" name="phone" class="text-input" />
                                        <label class="error" for="name" id="phone_error">This field is required.</label>
                                    </li>                           
                                    <li>
                                        <label for="comments" id="comments_label">Boston Brewery Booking Requested Date</label>
                                        <textarea id="comments" type="" name="comments" class="text-input">Required Date</textarea>
                                        <label class="error" for="comments" id="comments_error">This field is required.</label>
                                    </li>
                                    <li>
                                        <button type="submit" name="submit" class="send" id="submit_btn" value="Send">Submit</button>
                                    </li>
                                </ol>
                            </fieldset>
                        </form>

    Your form and php works ok for me. I can't see a reason for it not to get the phone details.
    What happens if you move the phone variable to the top of the stack (not that it should make any difference)
    $phone = $_REQUEST['phone'] ;
    $name = $_REQUEST['name'] ;
    $email = $_REQUEST['email'] ;
    Phone: $phone\n
    Name: $name\n
    Email: $email\n

  • Tracking emails sent through SAP using Outlook Integration

    Hello experts,
    I have a question regarding Outlook Integration.
    Can emails through SAP be tracked using SAP?
    The customer is using Outlook Integration. When an email (containing an invoice for example) is sent through, the email is stored in the users sent folder in Outlook.
    Is there a way that SAP can track all sent emails through SAP through an activity or some other feature?
    Thank you,
    Andy

    Hi Guest 47,
    Have you found any solution to your problem ? If yes, please let me know. I would be really thankful.
    Thanks & Regards
    Ankit Chauhan

Maybe you are looking for