Problem with span style in javamail if html is created using ms word.

I am using microsoft word to create the html which acts as a html template.
Following code gets created for image part in html.
<p class=MsoNormal><img width=390 height=200 id="_x0000_i1025"
src="http://imagesource/test.gif"><b><i style='mso-bidi-font-style:
normal'><span style='color:red'>Testing</span></i><span style='color:red'> </span></b></p>
I am reading this file in stringbuffer sb and sending using file
msg.setDataHandler(new DataHandler(
          new ByteArrayDataSource(sb.toString(), contentType)));
where contentType is "text/html"
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
msg.setContent(multipart);
String fromAddress = getProperty("email.fromaddress");
InternetAddress FROM = new InternetAddress(fromAddress);
msg.setFrom(FROM);
InternetAddress[] addressto = {new InternetAddress(toEmailAddress)};
msg.setRecipients(Message.RecipientType.TO, addressto);
msg.setSubject("Test");
Transport.send(msg);
but in mail it gets converted to
<p class=MsoNormal><img width=390 height=200 id="_x0000_i1025"
src="http://imagesource/test.gif"><b><i style=''><span style=''>ATT</span></i><span style=''> </span></b></p>
here span style is blank.
which is avoiding colors to display.

I am reading this file in stringbuffer sb and sending using file
msg.setDataHandler(new DataHandler(
          new ByteArrayDataSource(sb.toString(), contentType)));
where contentType is "text/html"
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);First you can simplify the above to:
messageBodyPart.setText(sb.toString(), null, "html");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
And if you're only putting one body part in the multipart, you can get rid of the
multipart completely and use "msg.setText".
As for your real problem, I don't know. It looks like you have a mix of single and double
quotes in your message, perhaps that's part of the problem? Print out the string you've
constructed before you send it to make sure it really has all the correct text.

Similar Messages

  • Having a problem with character styles in indesign

    I'm having another problem with my style sheets in indesign, I've now got an awful lot of styles in paragraph and character styles. I've created different styles for paragraph justified text and when I go to my style in paragraph styles to use tight text copy, character styles always overides it so it means I have to do  whole lot of extra formatting just to put it right. Does anyone have an idea how I can stop character styles overiding paragraph styles? Thanks very much.

    Perhaps your character styles apply more than you actually want? I.e., rather than just "+Italic" it also applies custom tracking. You should use character styles only to override the stuff you really want to change.
    You can check by calling up the definition for those character styles; the huge "Style Settings" text box lists all the attributes it changes.

  • I used to have a podcast that had been accepted on Itunes, but my I began to have problems with my host, so I changed host and created a new podcast, and I submitted my new podcast, Apple refused, and now says the feed has already been submitted??

    I used to have a podcast that had been accepted on Itunes, but my I began to have problems with my host, so I changed host and created a new podcast, and I submitted my new podcast, Apple refused, and now says the feed has already been submitted? Maybe Itunes thought that I was someone trying to copy my old podcast because I kept the same name, I tried to change the names but it looks like I'm on a blocked list...

    There is a procedure for changing the feed URL for a podcast, which it seems you haven't followed: you have to add a special tag to the old feed - just submitting a new feed will have exactly the effect you describe. The proper method is described here:
    http://www.wilmut.webspace.virginmedia.com/notes/podcast.html#move

  • Problem with Photoshop CS6. If I open a file using Camera RAW

    I have a new problem with Photoshop CS6.  If I open a file using Camera RAW, and process it as usual, CS6 doesn't want to save it the way it used to.  I don't know if I changed something by accident or not. 
    Here's what happens now: After opening from ACR to CS6 and completinhg all of my work, I choose "Save as..."  The save as window opens showing the file name and format.  The default format seems to be .PSD.  I use the drop down to select .jpg.  The file saves normally as a .jpg.  When I go to close the image from, I get a new prompt asking, "Save changes to Adobe Photoshop document DSC_xxxx.NEF before closing?
    I looked up at the file name in the bar above the work space and noticed that it does NOT change from "DSC_xxxx.NEF" to "DSC_xxxx.jpg" after I have saved the file as a .jpg,in my webesite  but it always used to do that.  This adds a few extra steps when closing a document and it really slows me down.
    In fact, I wouldn't swear to this, but I think it used to save to .jpg by default, without me specifying this.
    I don't see a setting in the preferences for what to use as the default file format for saving, so I don't know where to change it back.
    Any ideas?
    Thanks in advance

    You are in the wrong forum;  You actually need Photoshop forum at this link:
    <http://forums.adobe.com/community/photoshop?view=discussions>
    Hope you can repost your question at the correct link.

  • I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    Can you open the Preview program without loading a file, like by itself?
    If it doesn't load then I suspect a corrupt Preview preference file.
    Deleting the System Preference or other .plist file
    Can you open other files with Preview, like jpg's and images?
    How about other PDFs? or is it just that one you have downloaded?
    Run through this list of fixes
    Step by Step to fix your Mac

  • Problem with InDesign CC redrawing the screen too slow while using Zoom tool

    Hello. I got a problem with InDesign CC redrawing the screen too slow while using Zoom tool. Sometimes it takes more than a secong to zoom in or out. However InDesign CS6, Photoshop CC, Illustrator CC works just fine. What could be the problem, videocard or something else? Below is my PC configuration: OS Windows 8 Pro (x64); processor Intel Core i7 2600k CPU 3,40GHz; video adapter NVIDIA GeForse GTS 450; monitor NEC PA271W (2560x1440).

    Yes it’s a bug. The trick is to select the tool and then left click the photo information strip and hold for a few seconds until you see the windows bar at the top of the screen (not responding)
    The lasso tool should then work normally.

  • I' ve got problem with my Apple ID. I would like to use my czech acount to buy new apps but there is stiil 1 $ left from my previous gift card. I don't remember the password and it seems to me no way to find solution....

    I' ve got problem with my Apple ID. I would like to use my czech acount to buy new apps but there is stiil 1 $ left from my previous gift card. I don't remember the password and it seems to me no way to find solution....

    Hoterka wrote:
    I' ve got problem with my Apple ID. I would like to use my czech acount to buy new apps but there is stiil 1 $ left from my previous gift card. I don't remember the password and it seems to me no way to find solution....
    There may be a solution but I doubt that the trouble will be worth the dollar that you'll gain.

  • HT4168 I have created an 100 page booklet in Pages, with many photographs, can I export it to ePub, and make an electronic book, because it says that "Note: The Pages document must have been created using a word processing template"?

    I have created an 100 page booklet in Pages, with many photographs, and much written word, can I export it to ePub, and make an electronic book, because it says that "Note: The Pages document must have been created using a word processing template"?....
    Basically what I want to do is publish the document into both an eDocument, and a hard copy document. What is the best way to do this?

    No Peter, this statement came right off the Apple ePub statement when outlining how to use ePub. the full context is:
    Creating ePub files with Pages
    Summary
    Learn how to create ePub files with Pages.
    Products Affected
    Pages '09
    ePub is an open ebook standard produced by the International Digital Publishing Forum. Pages ’09 lets you export your documents in ePub format for reading with iBooks on iPhone, iPad, or iPod touch.
    iBooks supports both ePub and PDF file formats, and you can export both from Pages.
    When to use ePub or PDF
    Use ePub when text is the most important part of your document, for example when you create a book, a report, a paper, a thesis, or classroom reading material.
    More details on using ePubUse PDF when layout is the most important part of your document, for example when you create a brochure, a flyer, or a manual with multiple illustrations.
    More details on using PDF
    Creating an ePub Document to Read in iBooks
    You can export any Pages word processing document to the ePub file format for reading in an ePub reader, such as the iBooks application on the iPad, iPhone, or iPod touch. Documents created in page layout templates can’t be exported to the ePub format.
    Documents exported to ePub format will look different than their Pages counterparts. If you want to get the best document fidelity between the Pages and ePub formats, style your Pages document with paragraph styles and other formatting attributes allowed in an ePub file. A sample document is provided on the Apple Support site that features styles and guidelines to help you create a Pages document that’s optimized for export to the ePub file format, which you can use as a template or a guide. To learn more about using paragraph styles in Pages, see the topics under the heading “Working with Styles” in the Pages built-in help.
    To read your ePub document in iBooks on your mobile device, you must transfer the ePub file that you create onto your device.
    To use the “ePub Best Practices” sample documentTo learn more about using the ePub format and get a better feel for how a Pages document might appear as a book in iBooks, it’s a good idea to download the “ePub Best Practices” sample document. After reading the guidelines and instructions within the document, you can use it as a template to create your own document. You can also import the styles from the sample document into a new document you create.
    Download the “ePub Best Practices” sample document at the following web address:
    http://images.apple.com/support/pages/docs/ePub_Best_Practices_EN.zip
    Do either of the following:Use the sample document as a template.Import the paragraph styles from the sample document into a new or existing Pages document.
    Export the document you create to ePub format to see how it looks in iBooks.
    Preparing an existing Pages document for export to ePub format
    Documents exported to the ePub format automatically appear with page breaks before every chapter. A table of contents is automatically generated, which allows readers to jump quickly to any chapter title, heading, or subheading in the book. In order to create a meaningful table of contents, it’s important to apply appropriate styles within your document. The ePub reader uses the paragraph styles to determine which items should appear in the table of contents for your book.
    Note: The Pages document must have been created using a word processing template.

  • Problem with CSS styles and Previewing in Firefox

    Hello,
    I recently rebooted my Mac OS X system (leopard) and reinstalled Adobe CS3. Before this I had virtually no problems with Dreamweaver and everything was running smoothly. However, now whenever I preview my pages in Safari, the CSS code is completely mangled.
    Also, my site won't preview in Firefox unless I close any existing tabs and exit Firefox completely. I have no idea why these problems are occurring, but I have pasted the code below so any advice would be extemely helpful.
    ---------------------------------html----------------------------------------
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv= "Content-Type" content="text/html; charset= UTF-8" />
    <title>armed and harmless</title>
    <link href="untitled.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
        <div id="nav">
        </div>
    </div>
    </body>
    </html>
    -----------------------------------css-----------------------------------
    @charset "UTF-8";
        background-color: #000000;
        background-image: url(images/header.jpg);
        background-repeat: no-repeat;
        margin: 0px;
    #wrapper {
        height: 800px;
        width: 1000px;
        margin-top: 0px;
        margin-right: auto;
        margin-left: auto;
        background-color: transparent;
        background-image: none;
    #wrapper #nav {
        background-color: transparent;
        background-image: none;
        height: 30px;
        width: 1000px;
        margin-top: 260px;
        clear: both;
        border-top-width: 1px;
        border-bottom-width: 1px;
        border-top-style: solid;
        border-bottom-style: solid;
        border-top-color: #FFFFFF;
        border-bottom-color: #FFFFFF;

    hey there,
    thanks so much for the insight on the firefox issue. hopefully they fix that soon.
    as for the css, i do have a screenshot of what's happening. the background image seems to repeat after the navigation bar instead of keeping the transparent background. it's extremely odd and i've never seen it before. it can be seen in the attached photo.
    thanks again for your help,
    -e

  • Problem with Css styles not showing in live view or when i browse

    I am using Mac osx 10.6 and building website with Dreamweaver CS5.  Sometimes div tags i create not showing styles or rendering in live view or when I browse but  showing in design view. I looked in dreamwever faq and they talk about not showing in design view to toggle the display styles. That is not the problem becuase it is check marked and I tried turning off and turning on and made no difference.I am using firefox browser.
    It happened before the other day too. But all of my other pages in this site that i have created the same way building with div tags and css styles. So not sure what the problem is. Maybe someone has a suggestion here.
    Johanna

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Portfolio</title>
    <style type="text/css"></style>
    <link href="css/jbstyles.css" rel="stylesheet" type="text/css" />
    <style type="text/css"></style>
    </head>
    <body>
    <div id="wrapper">
      <div id="mainnav">
        <div id="navbar">
          <ul>
            <li><a href="index.html"><br />
            </a></li>
    <li>
              <ul>
                <li><a href="index.html">          Home</a><a href="about.html">About</a></li>
                <li><a href="portfolio.html">Portfolio</a><a href="contact.html">Contact</a></li>
              </ul>
            </li>
          </ul>
      </div>
        <div id="contentinside">
          <div id="navbar2">
            <ul>
              <li><a href="design.html">Design</a></li>
              <li><a href="multimedia.html">Multimedia</a></li>
              <li><a href="webdesign.html">Web Design</a></li>
            </ul>
          </div>
          <div id="mm1thumb">Content for  id "mm1thumb" Goes Here</div>
          <div id="mm2thumb">Content for  id "mm2thumb" Goes Here</div>
        </div>
        <img src="images/multimsidebar.gif" width="212" height="615" alt="mmsdbr" longdesc="http://multimsidebar" />
      <div id="footer">
        <p> </p>
        <p>Johanna Bresnahan</p>
        <p>Web &amp; Graphic Design - http://www.johannabresnahan.com</p>
        <p> email: [email protected] ....phone....857•991•5717<br />
      </p>
    </div>
    </div>
    <!--end wrapper--></div>
    </body>
    </html> 
    Here is the html code above. not sure how to attach my file so get a visual. This is the first time I have used this forum.
    Johanna

  • Strange problem with Zen Style 300

    I got a Zen Style 300 for my birthday and it is given me some problems. I tried looking at this forum and on google, but so far haven't found anything like it. What happens is that during the sync process, some folders on my portable harddisk (which is where the music is located) get renamed into names with strange symbols and become unreadable. The strange thing is that it doesn't happen with all files and just as strange is that it does happen with files not related to the sync that are located in a completely different folder. You can imagine I got quite scared the first time, afraid of having lost my music collection, but on restart everything was fine again. Until I plugged in the ZEN again that is.
    My second problem is probably related to it. Part of the files transfered to the player don't show up when I try to listen to them with the player. When I check they have been copied to the player correctly, yet somehow they don't show up.
    I have Windows XP and tried syncing with the standard Creative software, MediaMonkey and iTunes but they all face the same problem. Although with the second problem it might happen that files copied one way don't show up, while the same files transfered with a different program do. All 3 cause the problem with my harddisk. I tried formatting the player and updating it. So anyone has any idea what might cause this?

    I have a similar problem. It recognized and paired with a Sony Ericsson MW600 Hi-Fi Bluetooth Stereo Headset once. I lost connection, could no longer connect, and tried to re-pair it. Now it recognizes the the headset's name (MW600), but when you try to pair with it stays on a "Please wait..." message. It will stay that way forever until I press the back (left) arrow. Then the message says "Remote Device not responding" and pairing fails. This MW600 headset pairs with other devices (cell phone, PC) just fine, though, so it's not malfunctioning.
    I suspect this might be a Bluetooth version compatibility issue? I say that because when I connect to a Jawbone Era (pretty new device, probably latest Bluetooth spec), everything goes fine.
    Also, if I clear all devices, then try to pair to just the Sony Ericsson MW600, I can get the M300 in a state where it hangs and will not respond to anything. I then have to press the reset button using a paperclip to start over.

  • Problem with ZEN Style M300

    When I trying to found bluetooth audio devices with ZEN Style M300,? the player get to freeze after a little bit time that is searching devices, and so I have to push the reset button for using again the player. :mansurprised:Anyone have the same problem?

    I have a similar problem. It recognized and paired with a Sony Ericsson MW600 Hi-Fi Bluetooth Stereo Headset once. I lost connection, could no longer connect, and tried to re-pair it. Now it recognizes the the headset's name (MW600), but when you try to pair with it stays on a "Please wait..." message. It will stay that way forever until I press the back (left) arrow. Then the message says "Remote Device not responding" and pairing fails. This MW600 headset pairs with other devices (cell phone, PC) just fine, though, so it's not malfunctioning.
    I suspect this might be a Bluetooth version compatibility issue? I say that because when I connect to a Jawbone Era (pretty new device, probably latest Bluetooth spec), everything goes fine.
    Also, if I clear all devices, then try to pair to just the Sony Ericsson MW600, I can get the M300 in a state where it hangs and will not respond to anything. I then have to press the reset button using a paperclip to start over.

  • Problem with Next Style in Paragraph Style

    The "Next Style" function is not working for me anymore! As an example, when  I make a subhead with a first paragraph specified as the Next Style, the specification for that paragraph does not take effect upon specifying the subhead in the previous paragraph. Anybody else having this problem, or am I just losing it, which is entirely possible! Thanks. DL

    Hi,
    Are you expecting it as some kind of dinamic tool?
    As far as I know it works in at least 2 situations.
    1. If you are typing text with paraStyle, defined with filled "Next Style" field, and you press "Enter" ==> next para will be formatted (during typing) with "Next Style".
    2. If your textFrame is set by ObjectStyle, and its textFrame.paragraphStyle property is choosen, and "next Style" checkbox is checked
         ==> you can build a logic chain of paraStyles which will be automatically applied to textFrame contents, when placed into.
    thanks

  • Problem with document style webservice

    Hi all,
    I have written a webservice with the style = document and the protocol = https. I am getting xml passed in correctly, but when I return xml from the webservice it has been encoded, i.e. "<" becomes "<". Additionally the xml header (<?xml versionn....)is not being returned.
    Any help would be most appreciated.
    Cheers
    Andy

    Hi Andy,
    Sounds like the XML is being converted into a string. Try the example
    using a org.w3c.dom.Element [1] or send the XML as an attachment [2].
    Regards,
    Bruce
    [1]
    http://webservice.bea.com/dom.zip
    [2]
    http://manojc.com/?sample5
    andy wrote:
    >
    Hi all,
    I have written a webservice with the style = document and the protocol = https. I am getting xml passed in correctly, but when I return xml from the webservice it has been encoded, i.e. "<" becomes "<". Additionally the xml header (<?xml versionn....)is not being returned.
    Any help would be most appreciated.
    Cheers
    Andy

  • Problem with DOCTYPE tag in the index.html for flex file

    When I have the following !DOCTYPE tag in the index.html file I use to load the flex swf file(s) both FireFox and Orical browsers both become horizontally shortened.  When the tag removed everything works fine.  Given that the !DOCTYPE tag is necessary for good html I'd really like to know what's going on.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    Good info on that site about HTML, unfortunatly it had nothing new for me.  I did double check and everything and I was doing things the way they recomend.
    I'm really bothered that this is happening.  The DOCTYPE tag should be used and it should not have this effect when added to the HTML generated by the Flex Builder.  Additionally the new Flash Builder does have the DOCTYPE tag in its generated HTML and this is very worrisome.

Maybe you are looking for

  • Shutdown, Restart, Sleep best method for looking after everything?

    I'm just wondering what Apples stance is on actually shutting down, starting up putting to sleep etc and its effect on the hardware? I'm sure i read a while ago that just having it a sleep was the best bet as it keeps the battery ticking over, doesn'

  • Canon mini Disk camera doesn't work if external drive connected

    A long story.      Anyway, I have a MacPro Intel Dual Core 266 Ghz with 5 Gbs RAM,  4 internal hard drives HD1~HD4 (HD1 OSX 250 and three 500Gb) and two external HD5 (two partitions~HD5 & Time Machine Backups) and HD6 (1 Tb each). I've been using a C

  • Where do I change the color of this text in the blog page?

    I'm trying to add a blog page to my non-template iWeb site. On the Main Page, I'm unable to change the color of the font in the hyperlinks, where the default reads "Day of Longboarding" and "Read more-". I don't know what I might be overlooking. Any

  • IMessage isn't working either is FaceTime

    I m trying to Start up my iMessage and FaceTime and it is saying" iMessage activation an error accrued during acctivation try again" I keep trying and it's not working HELLPP

  • JDeveloper & Eclipse Plugins

    Hello, I thought Oracle wrote the specification regarding plugins? If that is true, will Eclipse follow these same guidelines and thus a plugin will be able to work in either JDev or Eclipse? There are so many more Eclipse plugin available it seems m