How to send an attached file containing with non-ascii code ?

10-11  Source: Network gathering  Views:0 

Advertisement
Hi,
I want to send a attaced text file containing with non-ascii code(Traditional Chinese). Is there any way to solve the encoding problem?
Currently, it transfer into non-meaningful code in receiving side.
Thanks for the help in advance.
Here is the code:
Session _gSession = null;
MimeMessage message = null;
Properties props = new Properties();
props.put("mail.smtp.host", smtpHost);
_gSession = javax.mail.Session.getInstance(props, null);
message = new MimeMessage(_gSession);
message.setFrom(new InternetAddress(emailSender , emailSender));
InternetAddress ia[] = new InternetAddress[1];
ia[0] = new InternetAddress(emailReceiver, emailReceiver);
message.setRecipients(Message.RecipientType.TO, ia);
message.setSubject("Test Encoding Attached File");
message.saveChanges();
BodyPart messageBodyPart = new MimeBodyPart();
DataSource fds = new FileDataSource("Big5_Code.txt");
messageBodyPart.setDataHandler(new DataHandler(fds));
messageBodyPart.addHeader("Content-ID","meme");
MimeMultipart multipart = new MimeMultipart("related");
multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
transport.connect();
transport.send(message);
Related articles
  • How to send an attached file containing with non-ascii code ? 10-11

    Hi, I want to send a attaced text file containing with non-ascii code(Traditional Chinese). Is there any way to solve the encoding problem? Currently, it transfer into non-meaningful code in receiving side. Thanks for the help in advance.Here is the

  • File upload with non-ascii name 10-11

    I'm designing a system that includes file-uploads. My problem is that any non-ascii chars in the filename are encoded strangely when saved. ä is encoded to å etc. I use Tomcat with the -Dfile.encoding="UTF-8" in the Catalina file. I get the sam

  • How to send an attachment with adobe form 10-11

    Hi in my application i have two process intiator and approval process both are adobe interactive forms,according to my scenarion i need to send an attachment(pdf or word document....)in intiatior to approval process,can pleasse tell me how to send th

  • Can anyone tell me how to send a PDF file so that it opens up in the body of the email itself? Thanks 10-11

    Can anyone tell me how to send a PDF file so that it opens up in the body of the email itself? ThanksThat is a function of the recipient's e-mail software understanding what your software sent.  If it doesn't it will always show as an icon or attachm

  • How to send an attachment thru mail in SAP? 10-11

    Hi all, I have an file which has been sent by the customer. The file type may vary each & every week (sometimes XLS, sometimes CSV & sometimes notepad). This file has to be sent to another person thru mail as an attachment. Is it possible to send

  • Attachment - File name with accents 11-30

    Hello, I finally realized why Mail was sending weird name attachements (.doc00, .doc\ca, etc.). It happens when a file name contains an accent (é, à, è...). Now, I'm French, so accents are very useful... I mean, why is this happening now? Is Mac OS b

  • How to send a text file to a printer? 10-11

    Hi, I'm in dark on how to send a text file to a printer through Java Stored Procedure. Here are what I tried so far (OS: win 2000, Oracle: 817 or 9i2): 1, Enable DOS command in Java Stored Proc. and try to send PRINT command there: public static Stri

  • How to send a JSP file in a MAU patch 10-11

    Hi friends, We need to send a patch for enhancement, which contains classes and a JSP file also.  So, we know how to send class files, but we are not aware of how to send a JSP file in the patch. Please help us if anybody know this. Thanks & Regards,

  • How to Send Multiple Attachment by SOAP Adapter 10-11

    Hi, How to send multiple attachment by SOAP Adapter. I am able to send single attachment but at the time of sending multiple attachment i am not able to see in SXMB_moni. Regards, AnuragOn the communication channel, please check the 'Do Not Use SOAP

  • How to send a PDF file as a FAX from Oracle Reports 6i 10-11

    Hi I want to know how to send a PDF file as a FAX from Oracle Reports 6i. Or please post any sample code in reports that sends PDF document as FAX Help need immediately. Thanks in advance. my email id is [email protected] Arun nullhello, there is no

  • How to send a large file in XI ? 10-11

    How to send a large file in XI ?hi, use a splitting mechanism to convert large files into smaller files and process them as if they where independent. You can use the "Recordsets Per Message" parameter in the File Adapter sender comm channel by

  • How to send smartforms as pdf attachments with e mail 11-30

    hi experts, how to send smartforms as pdf attachments with e mail??? nitinHi In the FORM Interface put proper parameter. Hope this helps.Read other 3 answers

  • Send an attachment in email with length more than 255 char per line 11-30

    Hi All, I have to send an attachment in email with length more than 255 char per line. I dont want to break the line after 255 char and add it in another line. Please suggest me any function module which can perform this. Thank you all.I looked at al

  • How do I open raw files taken with Canon 70D.  Not supported in Elements 12.  Is there a download?  Thanks. 11-30

    How do I open raw files taken with a Canon 70D?  Elements 12.  Version 8.0 Windows 7 64 bit.  Thanks in advance for any help. JWT Lamar, COThank you so much for you quick answer.  Works fine, now.  Thanks again, Barbara. JWTRead other 5 answers

  • Can't get the attachment filename out of a Part (with non ascii characters) 10-11

    Hello, all and happy new year :) My issue is with non ascii filename in attachments... Yes i've read the FAQ : http://www.oracle.com/technetwork/java/faq-135477.html#encodefilename I can't get the filename out of the BodyPart for those kind of attach

  • UploadedFile and filenames with non-ascii chars 10-11

    Hi I'm using an UploadedFile object in my web app, and all works fine. However, when I try to upload a file, with a filename containing non-ascii chars (e.g. Spanish), I see that the getBytes method returns an empty byte array, the filename is not st

  • Problems with non-ASCII characters on Linux Unit Test Import 10-11

    I found a problem with non-ASCII characters in the Unit Test Import for Linux.  This problem does not appear in the Unit Test Import for Windows. I have attached a Unit Test export called PROC1.XML  It tests a procedure that is included in another at

  • Filling clob with non ascii characters 10-11

    Hello, I have had some problems with clobs and usage of german umlauts (����). I was'nt able to insert or update strings containing umlaute in combination with string binding. After inserting or updating the umlaut characters were replaced by strange

  • Cannot connect to WPA network with non-ascii password 10-11

    In my office somebody thought it would be a good idea to encrypt the wireless network with a WPA password containing a non-ascii character. It is fine by the WPA2 standards, but the airport password prompt doesn't allow me to introduce suche characte

  • Mail IMAP after 10.5.2 can't read ANY mails in boxes with non-ascii names 10-11

    I have Mail with IMAP that connects to a regular MAC OS X Tiger server running IMAP. After upgrading to 10.5.2 on the client, Mail can no longer read ANY mails at all in any mailbox whose path contains a non-ascii character! Hence: If a box is called