Need special encoded characters in an Email subject with java 1.3.1_02

I need to find a way to construct an Email through java with Subject lines built using characters from various Asian encodings. Such as Shift-JIS, Chinese Big5, etc.
These encodings cannot be in UTF-8 format and must remain in the native character set.
For testing I have an HTML file constructed using a single line of text with Shift-JIS characters. This file shows properly in web browsers under the Shift-JIS encoding view, and when used to create the body of an email it works perfectly through the DataHandler. However, I cannot get any java Reader to pull the same stream of characters into the Subject of the email. The Subject is always garbage no matter what I do.
Here is a small code sample with the relevant lines:
Session session = Session.getDefaultInstance(System.getProperties(), null);
MimeMessage reSend = new MimeMessage(session);
Transport ship = session.getTransport();
BufferedReader s = new BufferedReader(new InputStreamReader(new FileInputStream("C:\\JavaPrograms\\Converted\\JISConv.html"), "SJIS"));
String resub = s.readLine();
s.close();
reSend.setSubject(resub);
DataHandler collect = new DataHandler(new FileDataSource("C:\\JavaPrograms\\Converted\\JISConv.html"));
reSend.setDataHandler(collect);
ship.send(reSend);If I use the "SJIS" encoding in the InputStreamReader above, all characters are shown as "?". If I delete it entirely and use the system default, I get half of the characters and the rest are garbage. I can generate either of those results using various other Japanese and Western encoding definitions.
I have tried using the above code, also DataHandlers for the Subject, FileReader directly to a String, ByteArrayInputStreams, and StringBuffers. So far everything I try ends up at the same result.
Can anyone help me out? I really need this to work. If I can get this one encoding to work, then I should be able to program case switches for the other encodings.
Thanks kindly!
Kurt Jackson

First this is an issue with javamail and not with java.
What makes you think that the mime standard allows what you want to do?
Both of your 'tests' have been done using alternatives which do support alternative encodings.
These encodings cannot be in UTF-8 format and must remain in the native character set.That seems rather unlikely to me. Email is transported using one encoding. Certainly SMTP uses only ascii. So what ever you put in there is going to be ASCII no matter what you do to it. I suppose something at the end might try to read it using an alternative encoding but then what happens when someone really wants to send those ASCII characters?
Mime, I believe, is built on SMTP. And the subject line is still SMTP and thus ASCII.
Here is one link that covers mime (you might want to check the backing references though.)
http://www.mindspring.com/~mgrand/mime.html
I believe there is some sort of official or unofficial standard for doing what you want. I would suggest that you start by getting that first. I would suspect JavaMail doesn't support it.
Once you have a standard to follow you have the following choices..
- Modify JavaMail directly to support this (this then becomes a non-distributable solution.)
- Extend JavaMail do support this. This might or might not be possible.
- Write your own implementation (don't use JavaMail.)
- Find another solution from another source that already implements this.

Similar Messages

  • How to Extract email subject with date from outlook?

    Hello,
    I am new to powershell and was wondering how i can extract the email subject with date for entire last month? i need to generate a report every month end and have to go through all the emails which can be very cumbersome at times. 
    Divyansh 
    Divyansh

     Ok i was able to find the commands but it only list email which are exactly 2 week old .. it does not list the recent items ..  
     Add-type -assembly "Microsoft.Office.Interop.Outlook" | out-null
     $olFolders = "Microsoft.Office.Interop.Outlook.olDefaultFolders" -as [type] 
     $outlook = new-object -comobject outlook.application
     $namespace = $outlook.GetNameSpace("MAPI")
     $folder = $namespace.getDefaultFolder($olFolders::olFolderSentMail)
     $folder.items  | where { $_.SentOn -gt [datetime]"3/1/2014" -AND $_.On -lt [datetime]"3/25/2014" }  | Select-Object -Property Subject, SentOn, Importance, SenderName
    Divyansh

  • Do I need to backup my pics and email etc with iCloud backup or would it delete my data?

    I have an ipad (3rd gen)  and an iPod (5th gen) I use the ipad for school as in my school instead of books and copies. I use my ipad for leisure and taking photos and videos and Facebook etc etc. both of the devices are using the same account. I only have the free 5GB backup package. I need the storage for my ipad school things as if I lose them..that's all my schoolwork..gone. I have recently taken a lot of photos with my iPod and downloaded a lot of games. Today a notification popped up saying that I'd almost run out of iCloud backup and that I could delete some of the backup on apps etc. so that's what I did and it barely made a dent in the backup figures. I then decided to delete most of my photos just so I'd have some more space for Facebook but it turns out that if you delete your photos, it doesn't actually result in a solution to the backup problem. So what I'm wondering is.. Do I really need to backup my pictures or email etc a and just leave the backup for my ipad? Also, when I go into Settings=>iCloud=>Storage & Backup=>Manage Storage=>this iPod at the bottom of the page there's a button that says "delete backup". I'm wondering if it would help my situation or something. Thanks in advance :)

    You don't need to back up your photos to iCloud if you don't want to.  If you don't, be sure to import them (and your videos) to your computer so they are backed up there, as explained here: http://support.apple.com/kb/HT4083.  You can then turn Camera Roll off under Backup Options.  This article explains other options for managing and reducing your iCloud storage: http://support.apple.com/kb/ht4847.
    If you tap Delete Backup in Manage Storage>your device, it will permanently delete the backup from iCloud.  It won't do anything to the data currently on your device, but it does put you at risk until you create a new backup.

  • Matching email Subject with attachment content

    Hello All,
    Here is my requirement.  I receive and email from a third party.  The emai Subject field has the name of the file that is the attachment.  I need to pick up the email with PI and put the attachment to disk as a file where the name of the file is the "Subject" field of the email.
    I have been able to write the attachment to disk as a file using the PayloadSwapBean.  But how do I collect the name of the file from the "Subject" field so I can use it as the name of the file when I write?
    Thank you for your assistance.
    Rich

    Use Dynamic Configuration. The Technical name for this Subject field in mail adapter is SHeaderSUBJECT. You can use it and assign it to FileName parameter of File adapter.
    Regards,
    Prateek Raj Srivastava

  • Problems replacing email-subject with SAPConnect

    Hi there,
    I'm sending an order confirmation via SAPConnect as email.
    The order confirmation attaches the email as a *.PDF file.
    Now i'd like to replace the standard subject, that consists in the spool-number and some text from  the message i use.
    So, i went to SPRO, and put 'Your Order: &VBAK-VBELN&' in the mai title. That worked almost properly, because the spool number stayed.
    So, i don't want this spool number output any longer.
    The second point is, that i've tried to replace the standard output of the mail text. I didn't succeed at all.
    So, my question. do you have any ideas to solve my problems?
    Thanks for reply, greetings and happy eastern
    Stefan

    msg.setText("<b>testeeeeeeeeeeeee</b>");R
    eplace that
    bymsg.setContent("<b>testeeeeeeeeeeeee</b>",
    "text/html");
    Thanks DrClap, but that's not exactly the solution I'm looking for, cuz I would have to hard-code that header.
    I have an Email class that I use as a wrapper for the javax.mail API, and I wanna be able to have a setHeader() method that works to enable the users to set the content-type of the text (or HTML) portion of the email, even when there are attachments. How can I achieve this?

  • HTML Toolbar in Email Compose with Java WebDynPro

    Hi Friends,
    We are working on a email functionality requirement and we are having a requirement to add a toolbar in the Email Compose Box. For ex. that toolbar contains Bold, Italic, Underline, and other HTML stuff. i.e. to decorate the text in compose box with HTML features.
    but we dont have any standard UI element in Java webdynpro to use.
    Can anyone suggest me the solution or if any one come across with such scenarios.
    Thank you very much in advance.

    Hello Srikanth
    Please refer to this featured <a href="/people/anilkumar.vippagunta2/blog/2007/02/01/office-control-in-webdynpro--i. Though this is not the direct solution to your problem, but I think you can take the hint to develop your compose box with toolbar containing different menus. Please have a look at the final application showcased in the weblog which u can embed in your compose- box. I hope you are getting me.
    Regards
    Kapil

  • Help needed :- Regarding multi prompts usage in FF3.0* with java script

    Hey i used the java script given in link :- http://sranka.wordpress.com/2008/11/09/how-to-replace-multi-go-button-prompt-by-one/#comment-96
    to hide multi-go-button in prompts and it works for IE 7 and firefox 2.0* with 10.3.4.1.
    Now since 10.1.3.4.1 is certified with firefox 3.0* ,when i use this same script in firefox 3.0* for my prompts it doesn’t work .
    Any idea why ? Please help me with this,as i want to use this hide go button feature in firefox 3.0* too.
    Are these scripts browser to browser incompatible ? If yes from where can i get the script for firefox 3.0* ?
    Awaiting for the inputs.
    Thanks,
    Nisha

    Quadruple-posting your issue won't get it resolved quicker. Please stop that. If you feel your thread needs to be on top, bump it by adding a "Any input?" post to it or something. Ome would assume that forums are around long enough for this trick to be known.

  • Broadcasting  - No suitable variables in email subject

    We need to include exit variables in email subject in broadcasting.       
    We created exit variables which are automtically calculated by the user   
    exit for broadcasting purposes. These variables are time variables that   
    indicates for example de day before, week from-to, ...                    
    We can't include them in the email subject. They seem not to be           
    available. Is there any way to do this?                                                                               
    We even tried with <OBJECT_DESCRIPCTION> standard variable, including     
    these variables in query title and expecting they were going to be        
    shown then on email subject. But they weren't.                            
    These exit variables are well calculated and shown in query title but     
    not in subject email through <OBJECT_DESCRIPTION> standard variable.      
    We supposed this solution should be work. But it doesn't ...              
    If we are wrong, could you please give as a solution to this issue.                                                                               
    Best regards.

    See if this helps.
    Reboot 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 try this,
    Quit the mail app completely and restart the iPad. 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 or anywhere above the task bar. Restart the iPad.
    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.

  • Send purchase order via email (external send) with special Czech characters

    Hi all,
    I am sending a purchase order created with ME21N via email to the vendor using "external send".
    The mail is delivered without any problems, PO is attached to the mail as PDF file.
    Problem is that special Czech characters as "ž" or "u0161" are not displayed, a "#" (hash) appears instead.
    This problem occurs when language for PO output = EN.
    Tests with language = CS worked out fine, but the whole form incl. all texts are in Czech as well; so no valid solution since it needs to be in English.
    We checked SAPCONNECT configuration and raised note 665947; this is working properly.
    When displaying the PO (ME23N) special characters are shown correctly as well.
    Could you please let me know how to proceed with that issue?!
    Thanks.
    Florian

    Hi!
    No, it's not a Unicode system.
    It is maintained as:
    Tar.          Lang.        Lang.        Output Format                           Dev. type
    Format
    PDF     EN     English                                                     PDF1
    Using this option, character "ž" was not displayed correctly, but "Ú" was ok.
    All other Czech special characters are not tested so far.
    Thanks,
    Florian
    Edited by: S. SCE - Stock Mngmnt on Aug 14, 2008 10:19 AM

  • Five days ago I received an email from an anonymous sender with the subject: Your Apple ID was just used to buy full album Elton John 312.99. Your receipt No. 37930343160405752. the content began: Content-Transfer-Encoding: base64 From (my email add

    Five days ago I received an anonymous email with the subject:
    Your Apple ID was just used to buy full album Elton John £12.99.Your receipt No.37930343160405752
    The content started: Content-Transfer-Encoding: base64 From:(my email address) followed by a very,very,very long stream of gobbledygook. There is no record of it in my i-tunes purchases or my credit card statement but that might only be because I have not updated my credit card details. Should I be worried that my account has been compromised? Does anyone know how I can get through to the right section of Apple to deal with this - all the emails I get say no-reply so I don't have an email address to contact them on.
    I would be most grateful if anyone could help me with this.
    Thanks in advance
    Walwal

    It's a phishing attempt to try and get your account and payment details - forward it to Apple : [email protected] , and then delete it
    Phishing emails : Identifying fraudulent "phishing" email - Apple Support
    Genuine emails : Identifying legitimate emails from the iTunes Store - Apple Support

  • Sender Mail Adapter - Need to pick all email only with subject "Send to Business Partner "

    Hi Experts,
    I have a mail to file scenario where I need to pick all emails with subject as "Send to Business Partner".
    I have seen one mail attribute SHeaderSUBJECT.
    Can I use this attribute to set a condition like SHeaderSUBJECT = "Send to Business Partner"  some where in configuration?
    Regards.
    Sree.

    Hi Hareesh,
    I am OK with that approach, but need to pick based on email subject.
    I have seen one of my previous project where if i send an email with "PI Process" subject then it was picking processing in PI.
    But i am not recollecting exactly what to do to get the same.
    Any other ideas please.
    Regards,
    Sree.

  • Problems with Special Characters on Exchange Email

    Hello:
    People I have a issue with our Corporate Email on my Iphone. We use Exchange 2003 and we have users with special characters on his emails address.
    I receive fine the email, just appear a errors on the display name. The issue is when I try to reply thie email. A error message popup said:
    Invalid Address
    "email with special characters" does not appear to be a valid email address. Do you want to send it anyway?
    If I press Yes, Iphone try to send the message But I receive another error message:
    Cannot send Mail
    An error ocurred while delivering this message.
    Any Help or Idea?
    Here My Email Configuration
    Email = Email
    Server = Server IP
    Domain = Work Domain Name
    Username = my user id
    Password = my password
    Description = Work
    Use SSL = ON
    S/Mime = Off

    When I Said "we have users with special characters on his emails address" its mean users with ñ,ó, ú, Ñ on his emails address. 
    When I said "just appear a errors on the display name" I mean characters like Âñ¡
    Thanks

  • HT1146 Just started using Apple mail.  Trying to set up email folders with Company/Company P.O. and it won't work.  Went to Edit and added special characters and it still won't work.  What am I doing wrong or can this not be done.

    Just started using apple mail.  Trying to set up email folders with example:  Company/Company P.O.  It won't let me do it.  It will not allow / or . .  What am I doing wrong or can this not be done.  I tried to use the Edit menu and adding the special characters, but it still won't work.  Please advise.  mmather

  • Gettign special characters while sending EMAIL Package

    Hi All,
    I wrote a PLSQL package to send a mail.
    While receiving mail , i am getting "!" special characters in the email.
    Anybody is any idea to avoid the special characters.

    user10761645 wrote:
    I wrote a PLSQL package to send a mail.
    While receiving mail , i am getting "!" special characters in the email.
    Anybody is any idea to avoid the special characters.Write 7bit ASCII e-mail payloads, and do not use HTML formatting.
    Remember that your code creates the payload (Internet Message Body) that is delivered (via SMTP) to the mail server. Your code controls the complete content of that message body.
    And when in doubt, look at the raw message payload received by the e-mail reader. E-mail readers will often render it differently, depending on the formatting rules and styles supported by that e-mail reader. And this is true even for plain text e-mails.
    If you can show us how the e-mail looks like and the code used to generate, perhaps we can be of more help.

  • PHP Email Subject - in Japanese?

    Bit of an odd one, I know...
    I've done a little site in Japanese, and everything works fine, apart from one thing...
    I have a mail script for the contact form, but the Japanese tect I've entered for the email subject is incorrectly displaying as ã&#129;&#130;ã&#130;&#138;ã&#129;&#140;ã&#129;¨ã&#129;&#134;ã&#129;&#148;ã&#129;&#150;ã&# 129;&#132;ã&#129;¾ã&#129;&#153;ã&#128;&#130;.
    Its fine in English, just not liking the Japanese.
    The code looks like:
    //start Trigger_SendEmail1 trigger
    //remove this line if you want to edit the code by hand
    function Trigger_SendEmail1(&$tNG) {
      $emailObj = new tNG_Email($tNG);
      $emailObj->setFrom("[email protected]");
      $emailObj->setTo("{email}");
      $emailObj->setCC("");
      $emailObj->setBCC("");
      $emailObj->setSubject("ありがとうございます。");
      //WriteContent method
      $emailObj->setContent("{firstname} 様<br /><br />この度はヒーリングハウス ハイジへのお問い合わせありがとうございます。<br /><br />スタッフが折り返し連絡しますので、今しばらくお待ち下さい。<br /><br />ヒーリングハウス ハイジ");
      $emailObj->setEncoding("ISO-8859-1");
      $emailObj->setFormat("HTML/Text");
      $emailObj->setImportance("Normal");
      return $emailObj->Execute();
    //end Trigger_SendEmail1 trigger
    If anyone has any suggestions to get the subject to display correctly in the Japanese, that would be much appreciated!

    The problem is that you're using Western European encoding, which supports only a limited range of characters. You should be able to use UTF-8 encoding:
    Change this:
    $emailObj->setEncoding("ISO-8859-1");
    to this:
    $emailObj->setEncoding("UTF-8");
    If that doesn't work, try this:
    $emailObj->setEncoding("Shift-JIS");
    Shift-JIS is a Japanese-specific encoding. UTF-8 is Unicode, which supports most writing systems, including Japanese.

Maybe you are looking for

  • Problems with NetWeaver 7.10 during/after patching SAP_ABA

    Hi! I have installed NetWeaver 7.10 and have started to patch the system with SAP_ABA from level 3 to 6, SAP_BASIS has already been imported without any issues. I then started the import and it looked like it was running, but there where no status ch

  • Windows XP Mode will not run

    I have installed Windows Virtual PC and Windows XP mode following the steps outlined on the Microsoft website. I enabled hardware virtualization in the BIOS, as requested, and then ran the hardware virtualization detect tool, and this indicated that

  • Backing up iTunes on version 10 is not workign1

    Hi, I downloaded itunes ten in the middle of my itunes music update and now it wont let me back up my files. please help!, Hi, I downloaded itunes ten in the middle of my itunes music update and now it wont let me back up my files. please help!

  • HT201210 ipod nano 6g doesn't turn on and won't be recognized by itunes

    Hi, I bought an iPod Nano 6g a couple of years ago. I tried to use it about a week ago. It did not turn on (not even the screen), no music, nothing!! I connected it to my Laptop (Mac), turned the iTunes on, nothing again!! It didn't even recognized i

  • HT1338 10.6.8 updates download but won't install

    I run OSX 10.6.8 2.3GHz Intel Core i5 MacbookPro 8,1 and for the life of me I cannot get the 14+ software updates to install. The technology should be invisible, that's the whole reason I abandoned Windows for Mac (so I could just do things and be in