Characterset not supported by Outlook  for messages from JavaMail w/ html

Hi, I have a Java mail program which works fine for text as well as small html content. But when the html content grew, my outlook tells me that the characterset is not supported and my message (from java) is an attachment instead of body of message. Besides that it also adds other mail headers (from the mail server) and adds other characters in the message so I cannot even filter out the data or look at it by saving it as html file.
Whats going on?
Heres my code for mail:
try{
String host = "mailserver";
String from = fr; // this is passed as paramter
String to = t; // this is also passed as parameter
String subject = "Error occured in Process.";
String content = cont; // cont is the message which is passed as string and contains html
content = content.concat("\n\nNote:\n\nThis message was generated by manually running the program.");
String attachmentFile = "c:\\grab.gif"; // file to be attached.
String bodyOfAttachment = "<h3>This is the body of attachment.</h3>";
Properties props = System.getProperties();
props.put("mail.smtp.host", host);
Session session = Session.getDefaultInstance(props, null);
Message message = new MimeMessage(session);
message.setSubject(subject);
message.setFrom(new InternetAddress(from));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
MimeMultipart multipart1 =new MimeMultipart("alternative");
BodyPart part=new MimeBodyPart();
part.setContent(content,"text/html");
multipart1.addBodyPart(part);
BodyPart messageBodyPart = new MimeBodyPart();
String htmlText = bodyOfAttachment;
messageBodyPart.setContent(htmlText, "text/html");
MimeMultipart multipart = new MimeMultipart("related");
multipart.addBodyPart(messageBodyPart);
messageBodyPart = new MimeBodyPart();
DataSource fds = new FileDataSource(attachmentFile);
messageBodyPart.setDataHandler(new DataHandler(fds));
//messageBodyPart.setHeader("Content-ID","<"+"memememe"+">");
multipart.addBodyPart(messageBodyPart);
MimeBodyPart mbp = new MimeBodyPart();
//Comment these two lines to not send attachment
//--mbp.setContent(multipart);
//--multipart1.addBodyPart(mbp);
message.setContent(multipart1);
Transport.send(message);
catch (AddressException ae){
     ae.printStackTrace();
catch (MessagingException me){
     me.printStackTrace();
}

Never mind I figured it out.
replace all occurences of
"text/html"
with
"text/html;charset=ISO-8859-1"

Similar Messages

  • HT4060 My USB charger is not supporting while i am connecting from PC to iPad for charging (showing as " Not Charging"), Kindly advice me

    My USB charger is not supporting while i am connecting from PC to iPad for charging (showing as " Not Charging"), Kindly advice me

    Hi Folks,
    I have tried most of what have been said here ( thank you for the great Job) but unforunatally it didn't solve the issue.
    However, now the "Not Charging" message in the right corner disappeared and my iPad is charging normally from my laptop.
    The reason behind that is using the USB3.0 port in my Dell inspiron N5110. Earlier, I was using the USB 2.0  ports and that is why it was showing that message but as sooon as I pluged it in the eSATA USB 3.0 port , the message disapeared and the iPad started charging normally.
    So don't waste ur time here and there try to plug it to USB 3.0 port and it will works, Insha ALLAH.
    Cheers
    KoRn

  • New Message, reply, or forward window does not open in Outlook for Mac 2011

    New Message, reply, or forward window does not open in Outlook for Mac 2011
    Outlook acts as if I am pressing a dummy button.

    Hi friends,
    I have the same problem.
    Mountain Lion + Office 2011 + Safari 6.1.2 (8537.74.9)
    It is not clear to me what is the relation between Safari and this problem.
    I have Chrome installed as well and it is set as default browser. Is this involved?
    If yes how can I solve the problem?
    Please let me know.
    Many thanks.
    Best regards
    Peval

  • Not able to create a message from satellite system

    Hello Everyone.
    We have been working on Solution Manager .We have managed with successfull installation,Uploaded required support packages,configured the system according to SAP Solution Manager Guide.
    Faced with some problem regarding support desk,we are not able to create a message from satellite system to Solution Manager.
    Note : Error Message related to this problem is ....
    <b>"Error in Local Message System : External number assignment, Enter notification num message was not Created."</b>
    Thanks in advance.
    Regards,
    Nimesh V . Master

    Hi, you need to check the number ranges for the notifications and make sure they are correct.  Look in the IMG of the SAP Solution Manager system for the instructions.  You also need to make sure that the Service Desk BC Sets are activated if you are NOT on 4.0 and SP Stack 09+.  In the later SPs much of this configuration from the IMG is automated in the wizard.

  • Why, when MobileMe was shuttered, does Apple NOT support calendar subscriptions for iCal (Calendar)?  I upgraded to Mountain Lion and cannot migrate my Dutch, U.K., Islamic, or Catholic holiday subscriptions.

    Why, when MobileMe was shuttered, does Apple NOT support calendar subscriptions for iCal (Calendar)?
    I upgraded to Mountain Lion and cannot migrate my Dutch, U.K., Islamic, or Catholic holiday subscriptions.  I had a heck of a time getting my Detroit Tigers Baseball team schedules migrated (but Major League Baseball supported the subscriptions, so it occurred).  As I work internationally, having these calendar subscriptions on the new Calendar would be very useful.
    If one goes to the Apple site, and seeks calendars [http://www.apple.com/downloads/macosx/calendars/index1.html], they are shunted to MobileMe [https://www.icloud.com/mobileme/not_found/], with the note "MobileMe is closed. Go to iCloud."  But, I do not see how to get subscriptions from iCloud.
    Thanks.

    The problem is that many of these calendars were hosted on MobileMe. I actually tried about 20 at random, and only two worked! Not all of the failures were ex-MobileMe, some were on other servers but produced 'File Not Found'.
    Strangely, this one worked despite its URL:
    http://ical.mac.com/ical/UK32Holidays.ics
    Until the people who publish these calendars (it's not Apple, they are third-party) wake up and find alternative servers these calendars are not available.
    There may be other sources which work - try Googling.

  • Lightroom 3 does NOT support raw files for the  Canon Sureshot S95

    Have just bought the new Canon Sureshot S95
    after contacting Adobe support I am told Lightroom 3 does NOT support raw files for the
    Canon Sureshot S95.
    Come on Adobe.....please provide an update asap.

    (1) Well Boss I did what you said and used Canon DPP to convert to TIFFs. Choices are 8-bit TIFF or 16-bit TIFF - I chose 16-bit because part (90% part) of the reason for wanting to work in RAW is to keep the bit depth of teh original. On my EOS 40D it is supposedly 14 bits, which gives great scope to play with the levels & curves without seeing poster effects. If I choose 16 bit TIFF then each S95 image becomes a 70MB file, parallel to my JPEG and RAW.  Hardly a satisfactory solution.
    (I realise, however, that I don't actually know the bit depth of the S95 RAW file - anybody? ). 
    (2) SUGGESTION-  even if you are adding S95 support to the next update (which I dearly hope), be kinder to those with new cameras in general and allow LR to import JPEGs if it cannot import the RAWs (overriding if necessary the 'ignore JPEG' preference setting).  I am sure users with that preference would still prefer a JPEG than no picture at all!
    Since I discovered this compatibility problem, I switched the camera to record RAW+JPEG*. To my great irritation LR3 ignores the JPEGs even though it cannot load the RAWs.  So if I want to import from one supported camera (EOS40D) and one unsupported camera (S95) I have to keep going into preferences to switch on and off the 'ignore JPEG' function.
    JJ
    *  (this seems to be a setting that needs doing in the various different modes of the camera, by the way).

  • HT201342 I have just opened an icloud email address and am unable to open ANY of the messages in my INBOX. I keep getting the message, "Cannot open this item. This operation is not supported until the entire message is downloaded. Download the message and

    I have just opened a new icloud email address and am unable to open ANY of the messages in my INBOX. For each item I get the message "Cannot open this item. This operation is NOT supported until the entire message is downloaded. Download the message and try again". I now have no clue what I need to do to open these items. Help please.

    What version of iPhoto do you have installed?  Is if one of the versions shown as not compatible in this screenshot?
    If it is then go to the App Store and download iPhoto 9.5.  It will be free if you have an iPhoto 9 or later verson currently.
    OT

  • Special Stock E not supported (check your entry) Message no.

    Hi,
    While we are doing the returns delivery, we are getting the error "
    Special Stock E not supported (check your entry)
    Message no. M7146
    Diagnosis
    The specified objekt (Special Stock E) is not supported."
    This is an M.T.O scenario
    In the returns order the requirement type is 'KE"
    The item category is REN
    Schedule line category is DN
    movement type is 651
    Kindly guide how to over come this issue.
    Warm Regards
    Somnath
    09903518371

    Dear somnath
    For information, in returns scenario, special stock indicator E will not support.  The logic behind this is that while taking back the goods into plant, you should not assign those stocks to original sale order.  Either you have to post the stock for Quality or to some new storage location.
    thanks
    G. Lakshmipathi

  • Most SharePoint DBs are not supported with AlwaysOn for Disaster Recover?

    Hi ...
    I'm in the middle of testing and assessing DR site for our SharePoint MSQQL instance. I found a lot of talking about ALwaysOn. I try to figure it out. It is nice and easy, combine DR and HA in single
    solution- Wow.
    After proceeding with some research I shocked when found only content and secure databases are supported in Async mode for DR site. We have Fail-over cluster (old fashion with shared storage) , what
    the beneftis that will give me AlwaysOn in my case from building a DR point of view.
    We are running hyper-v and SQL 2012 

    Thanks Sean for your explaining the answer.  Actually I have many options, but the important thing as you said these things you wouldn’t play with. I need something is stable and strong without any complications.
    My options are
    User either AlwaysOn failover cluster OR  Old windows cluster for HA with log shipping for DR.
    For me this is supported and somehow acceptable.
    User either AlwaysOn failover cluster – Old windows cluster for HA along with AlwaysOn for DR as Async replica. Still not supported from Microsoft.
    We have already windows failover cluster with shared storage and I can go directly with log shipping for DR. However, still log shipping is not supported as DR for SharePoint but I’m going to make it as new instance and direct SharePoint farms to the DR
    site.  This procedure tested as moving database SharePoint instance to new server. It is worked well and straight forward.
    Again,  I cannot use AlwaysOn for SharePoint as DR while it is not supported (Contents and Secure is supported however as HA is fully supported).

  • Data field FUNCTIONAL_YN does not support the default value (Message 14120)

    L.S.,
    When defining a data type of category NC, I would like to use data fields of type checkbox. At NC logging data entry the checkbox should be "checked" by default.
    When looking for the proper value to indicate that the ccheckbox is selected, I have tried values like: 0, 1, TRUE, FALSE, T, t, X, x ... etc. But always I got the same error message:
           "Data field FUNCTIONAL_YN does not support the default value (Message 14120)"
    What should be the right value?
    Kind regards, Hans

    Hans,
    It looks as if by means of GUI you cannot specify default state of being selected for Checkbox field. The default state is unselected.
    It is easier to invert the statement in the label of the field so that an operator could use unselected state as default.
    Regards,
    Sergiy

  • I can not install the firefox for android from the android market. It is showing me that the app is incompatible with my device. Mine is LG P500 with version Froto 2.2.2. Any help ?

    I can not install the firefox for android from the android market. It is showing me that the app is incompatible with my device and no other information is provided. I am not sure whats the problem with that ! Is it incompatible with the device or the android version ?
    Mine is LG P500 with version Froyo 2.2.2. Any help ?
    I was waiting to surf web with firefox from my phone for a long time. can anyone please let me know any known solution to it.

    The mobile version of Firefox for Android requires a processor that supports the ARMv7 architecture, the LG Optimus P500 does not meet that requirement, it supports the ARMv6 architecture.

  • Can you turn off the "Charging not supported with this device" messages?

    I recently bought a standard dock extender cable in order to connect my iPad to my Apple HiFi and have had music from Pandora constantly interrupted by sporadic "Charging not supported with this device" messages. The messages will continue to come up repeatedly despite pressing the "Dismiss" bar repeatedly.
    Is there a way to turn those kinds of warnings off in either iPad Settings or in iTunes when docking the iPad?

    Try connecting the iPad to the iPod Hi-Fi with a male to male mini-stereo cable. I use one of these cables to connect my Airport Express to my iPod Hi-Fi, so that I can use it with AirTunes.
    You can even combine the cable with the Apple iPad Dock, which would let you charge the iPad while using it with the iPod Hi-Fi.

  • HP UFT 12.02 does not support .object property for most of the objects in Chrome

    Hi ,
    Chrome Version : 39
    UFT Version : 12.02
    Does not support .object property for WebTable,webList and So on.
    It actually shows the native property in Object spy but when programatically we try to work on it, its unable to find the object.
    I Know that for Browser Object .object property is not supported.
    Regards,
    Ashfaq Dhanakwala

    You want the HP Enterprise Business Community and look in the Discussion Boards.
    Its the Forum for all things related to professional products like Servers, NAS, Procurve, ALM, etc etc.
    UFT was formerly known as QTP...
    Functional Testing/QTP - HP Enterprise Business Community
    Hope it helps.

  • Why does Verizon not support Windows 8 for wi fi?

    Why does Verizon not support Windows 8 for wi fi?  Are they planning on supporting Windows 8?
    Solved!
    Go to Solution.

    Verizon wi fi for hot spots does not work with Windows 8.  For verification go to FAQs about Verizon Wi-Fi for FiOS Internet, 
    http://www.verizon.com/Support/Residential/Internet/fiosinternet/networking/setup/wi-fi/124650.htm , and click on How do I know if my laptop or netbook is compatible with Verizon Wi-Fi? .  Verizon wireless home network does work well with Windows 8.
    Since you can't even download the wi fi for hot spots software if you have Windows 8, I don't know how to use compatability mode to get around the problem,

  • I do not get mobile notification for messages on ...

    I do not get mobile notification for messages on  Android device Please Help?

    Hi,
    Couple of questions:
    Are you on the latest Android version?
    Did you receive notifications in the past but they then stopped arriving?
    Do you receive calling and/or chat notifications only?
    Do you share your device with others who log into a different Skype account?
    Regards,
    Brad
    Microsoft Skype Notifications PM
    PM/PO Notifications RV
    Microsoft Skype Prague

Maybe you are looking for

  • Assign Type conflict error

    Hi, I am trying to load the data from PSA to write optimised DSO in production and it is throwing me an error 'Short dump :Assign Type conflict error". I have no routines in the transformations.Source data types are matching with target data types. I

  • HT1212 My ipad is disabled, and can't unlock it

    I already did the step by step procedure for a forgotten passcode, but its still telling me I can't unlock it

  • Struts PgFlow error using a RowSet control in WL 8.1 SP1

    I created a RowSet Control within an existing WAR and setup a PgFlow process to CRUD my linked datasource.           When i run or view the pageflow it builds and deploys fine and I am able to view the generated main grid.jsp containing all my data i

  • Very weird glitch when typing "fi"

    When I type "fi" the two letters become as one. As in, I can't select just the "f" or just the "i." It only selects them both at the same time (although I can delete them separately with a backspace). This doesn't happen with capital letters or with

  • Mdx : Sum up the measure from start but need only non empty rows

    Hi All i have created a calculated measure where it suming up all its previous avaialable values based on Date dimension. Everything is working but we are getting all rows from that datetimension . how can get only till current date, SUM(NULL:[Date].