File attachment issue in MimeMessage [Mail API]

Hi,
I tried to attach PDF and XML file in MIME Message of MAIL API. I want attach encoded PDF and XML file with gzip format.
I’m able to attached both the files but its not attached properly and when i tried to retrieved back from MIME Message, I’m getting error.
Error is
java.util.zip.ZipException: oversubscribed literal/length tree
     at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:147)
     at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:92)
     at java.io.FilterInputStream.read(FilterInputStream.java:90)
     at com.asite.supernova.test.CreateReadMimeMessage.ReadMail1(CreateReadMimeMessage.java:145)
     at com.asite.supernova.test.CreateReadMimeMessage.main(CreateReadMimeMessage.java:48)
Here my code
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Date;
import java.util.Enumeration;
import java.util.Properties;
import java.util.zip.CRC32;
import java.util.zip.Deflater;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.mail.BodyPart;
import javax.mail.Header;
import javax.mail.Message;
import javax.mail.Multipart;
import javax.mail.Session;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import org.apache.commons.codec.binary.Base64;
import com.sun.istack.internal.ByteArrayDataSource;
public class CreateReadMimeMessage {
     public static void main(String[] args) {
          CreateMail();
          ReadMail1();
     public static void CreateMail(){
          try{
               Properties properties = System.getProperties();
             Session session = Session.getDefaultInstance(properties);
             Message msg = new MimeMessage(session);
             msg.setSentDate(new Date());            
             Multipart multipart = new MimeMultipart();
             BodyPart part1 = new MimeBodyPart();           
             part1.setFileName("test.pdf");                               
             part1.setHeader("Content-Type", "application/pdf");
             part1.setHeader("Content-Encoding", "gzip");
             part1.setHeader("Content-ID", "PDF");
             //1
             compressFile("test.pdf","testpdf.gzip");
             String encodedData = new String(getBytesFromFile(new File("testpdf.gzip")));
             //1
             DataSource ds = new ByteArrayDataSource(encodedData.getBytes(), "application/pdf");            
             DataHandler dh = new DataHandler(ds);
             part1.setDataHandler(dh);
             //part1.setText("This is only text data");
             BodyPart part2 = new MimeBodyPart();
             part2.setFileName("test.xml");
             part2.setHeader("Content-Type", "application/xml;");
             part2.setHeader("Content-Encoding", "gzip");
             part2.setHeader("Content-ID", "XML");
             part2.setHeader("Content-Transfer-Encoding", "base64");
             //1
             compressFile("test.xml","textxml.gzip");
             String dataXML = new String(getBytesFromFile(new File("textxml.gzip")));
             DataSource ds1 = new ByteArrayDataSource(dataXML.getBytes(), "application/xml");
             DataHandler dh1 = new DataHandler(ds1);
             part2.setDataHandler(dh1);            
             multipart.addBodyPart(part1);
             multipart.addBodyPart(part2);
             msg.setContent(multipart);
             msg.writeTo(new FileOutputStream(new File("MIMEMessage.xml")));
          }catch (Exception e) {
               // TODO: handle exception
               e.printStackTrace();
     public static void ReadMail1(){
          try{
               Properties properties = System.getProperties();
             Session session = Session.getDefaultInstance(properties);
             InputStream inFile = new FileInputStream(new File("MIMEMessage.xml"));
             Message msg = new MimeMessage(session,inFile);     
            Multipart multipart = (Multipart) msg.getContent();
            for (int i = 0; i < multipart.getCount(); i++) {              
                BodyPart bodyPart = multipart.getBodyPart(i);
                Enumeration enumHeader = bodyPart.getAllHeaders();
                String fileExt="";
                while(enumHeader.hasMoreElements()){
                     Header header = (Header) enumHeader.nextElement();
                     System.out.println(header.getName() + ":" + header.getValue());
                     if(header.getName().equalsIgnoreCase("Content-ID")){
                          if(header.getValue().equalsIgnoreCase("pdf")){
                               fileExt=".pdf";
                          }else if(header.getValue().equalsIgnoreCase("xml")){
                               fileExt=".xml";
                BufferedInputStream inn = new BufferedInputStream(bodyPart.getInputStream());
                GZIPInputStream gzin = new GZIPInputStream(inn);
                // Open the output file
                   String target ="File"+i+fileExt;
                   OutputStream outf = new FileOutputStream(target);
                   // Transfer bytes from the compressed file to the output file
                   byte[] buff = new byte[128];
                   int lent;
                   while ((lent = gzin.read(buff)) > 0) {
                        outf.write(buff, 0, lent);
          }catch (Exception e) {
               // TODO: handle exception
               e.printStackTrace();
     public static void compressFile(String input,String output) {
          try {
               // Create the GZIP output stream               
               OutputStream out = new GZIPOutputStream(new FileOutputStream(output));
               out =new BufferedOutputStream(out);
               // Open the input file
               //FileInputStream in = new FileInputStream(input);
               InputStream in = new BufferedInputStream(new FileInputStream(input));
               // Transfer bytes from the input file to the GZIP output stream
               byte[] buf = new byte[524288];
               /*int len;
               while ((len = in.read(buf)) > 0) {
                    out.write(buf, 0, len);
               int count;
               while((count = in.read(buf, 0, 524288)) != -1) {
                    System.out.println(new String(buf, 0, count));
                    out.write(buf, 0, count);
               out.flush();
               in.close();
               // Complete the GZIP file
               //out.finish();
               out.close();               
          } catch (Exception e) {
               e.printStackTrace();
     public static byte[] getBytesFromFile(File file) throws IOException {
        InputStream is = new FileInputStream(file);
        // Get the size of the file
        long length = file.length();
        if (length > Integer.MAX_VALUE) {
            // File is too large
        System.out.println("File Len : " + length);
        // Create the byte array to hold the data
        byte[] bytes = new byte[(int)length];
        // Read in the bytes
        int offset = 0;
        int numRead = 0;
        while (offset < bytes.length
               && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
            offset += numRead;
        System.out.println("offset : " + offset);
        // Ensure all the bytes have been read in
        if (offset < bytes.length) {
            throw new IOException("Could not completely read file "+file.getName());
        // Close the input stream and return bytes
        is.close();
        return bytes;
}Please help me asap.
Edited by: sabre150 on 10-Feb-2011 01:50
Moderator action : added [ code] tags to make the code readable.

String is not a suitable container for binary data so unless the two lines
             compressFile("test.pdf","testpdf.gzip");
             String encodedData = new String(getBytesFromFile(new File("testpdf.gzip")));actually Base64 encode the file content you are probably corrupting your file.
I suspect you should be Base64 encoding the compressed file and modifying the mime-type to reflect this.

Similar Messages

  • SQL Server 2008 .MDF File attaching issue

    Hy all guys here is big Happy news about the SQL Server 2008 database.mdf file attaching issue on Windows 8.1 and SQL Server 2008
    I found the solution like this
    first you go to the directory of your computer and go to that folder where your database and other files are like
    folder having database and files then > Right click and > security > then give full rights from which user you LOGIN and then apply > ok after that go to SQL Server 2008 > Right Click > run as administrator
    Hurray your problem will be resolve I Resolved my issue too  thanks to providing every solution
    if you guys find solution please give me best regards thanks  

    Hi Farhan-Islam,
    Glad to hear that your issue had been solved by yourself. Thank you for your sharing which will help other forum members who have the similar issue.
    Regards,
    Lydia Zhang

  • Issue with JAVA Mail API

    Hi
    We have a requirement to create a custom e mail. For the same I am trying to use Java Mail API.I am facing an issue with the following code:
    session session1 = session.getInstance(properties, null);
    System gives an error Sourced file: inline evaluation of: ``Properties props = new Properties(); session session1 = session.getInstance(prop . . . '' : Typed variable declaration : Class: session not found in namespace
    Is there some specific API i need to import for session class. Kindly suggest.
    Regards
    Shobha

    Hi Shobha,
    I was also facing the same issue from last couple of weeks and just now i have achieved the working functionality.
    Please find below working code and replace values as per your serveru2019s configuration.
    import com.sap.odp.api.util.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.io.File;
    import java.net.*;
    // SUBSTITUTE YOUR EMAIL ADDRESSES HERE!!!
    String to =<email address>;
    String from =<email address>;
    // SUBSTITUTE YOUR ISP'S MAIL SERVER HERE!!!
    String host = <smtp host name>;
    String user = <smtp user name>;
    // Create properties, get Session
    // Properties props = new Properties();
    Properties props = System.getProperties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", host);
    props.put("mail.debug", "false");
    props.put("mail.smtp.auth", "false");
    props.put("mail.user",user);
    props.put("mail.from",from);
    Session d_session = Session.getInstance(props,null);//Authenticator object need to be set
    Message msg = new MimeMessage(d_session);
    msg.setFrom(new InternetAddress(from));
    InternetAddress[] address = {new InternetAddress(to)};
    msg.setRecipients(Message.RecipientType.TO, address);
    msg.setSubject("Test E-Mail through Java");
    msg.setSentDate(new Date());
    msg.setText("This is a test of sending a " +
    "plain text e-mail through Java.\n" +
    "Here is line 2.");
    Transport.send(msg);
    Deepak!!!

  • How to extract a .eml (e-mail file) "attachment" from an e-mail

    Hi,
    I have a slight problem with e-mail attachments. It's quite an explanation, so stick with me please.
    I have to extend, debug and adapt an e-mail archive for my company.
    I already worked on this project for 2 months, to make an extra batch and change some functionality of the existing e-mail archive.
    I've been outsourced for a montsh, and now back on the e-mail archive.
    There were some problems with e-mail attachments. (.gif, .doc, ...)
    Some of them weren't shown in the web application.
    The code that already has been written has a custom Email object. This e-mail object contains custom EmailBodyPart objects. Every EmailBodyPart has a disposition (Part.INLINE or Part.ATTACHMENT).
    In every JavaMail Message object, every BodyPart is read, the disposition is extracted, and an EmailBodyPart is created with the disposition and some other data. Then, this EmailBodyPart is added to the Email object.
    But sometimes, an attachment (.gif, .doc, ...) doesn't have the correct disposition in a Message, and isn't added as attachment, but as INLINE.
    This way, in the web application, there aren't any attachments visible for the e-mail, but when you send the mail back to your inbox through the web interface, you can see the attachments again.
    I had to solve this, and make the attachments visible in the web interface, and i did. I just checked if a filename was present, and if it wasn't an image (images still can be inline), then the disposition of the EmailBodyPart is set to Part.ATTACHMENT. It is visible now.
    But now on to the problem...Sometimes, an e-mail (.eml file) is added to an other e-mail as an attachment. But, this e-mail isn't included as disposition attachment, but just as an other message within the message. It doesn't even have a file name. It seems like this is just a forward or something.
    This e-mail should be visible as an attachment of the surrounding e-mail within the web interface. Does anyone have an idea how i can accomplish this and extract this body part as an attachment? Are there any headers i can check? (I printed the headers of the body part and there were only three, content-type, encoding en such ... but nothing like disposition. I tried to set the disposition to attachment to make it visible as an attachment, but that didn't work.
    Thanks already in advance.

    Hi there,
    Thanks for your reply.
    Well, it was kind of a mistake in the webapplication itself. The object passed to the related method was an instance of MimeMessage (the previous programmer only checked MimeMultiParts), and those weren't added to the vector of attachments. Now they are.
    But now i still have problems. I have to give those attachments a file name. I tried extracting the subject from the message, but in the related method the message is casted to a multipart (is needed for further processing), and i can't fetch the sub-message's subject (if i get the part, i can't get the subject header anymore).
    If i don't give the file a .eml extension, it opens a MHTML file or something, and it is unreadable by windows. If i get an InputStream of the part's content, and return that, and give the attachment a .eml extension, i get the outlook window , but all the text is pure HTML code. Not like it should be, and the mail in Outlook doesn't have any headers (no from, no to, no subject, ...)
    Any idea here ? I could suply you with some code, but i don't understand all the steps myself, i got on this project which was build by someone else. It's quite a lot of code.
    Thanks in advance.

  • File attachment issue persists

    The OTA update was supposed to fix the issue of allowing a file greater than 5mb to be attached to emails.  After the update, I still can't attach a file greater than 5mb.  Will this issue get corrected soon?

    Here is the wording from the update pdf file on Verizon's Support website:  I made bold and enlarged the line about fixing the 5mb limit issue.
    Enjoy improved performance with these OS enhancements.
    pleased to announce a new software update for your Droid Incredible by HTC. The HTC
    (3.26.605.1/Baseband Version: 2.15.00.07.28) update includes numerous enhancements
    and improvements.
    Verizon Wireless and HTC encourage you to download this update.
    Improvements:
    Updated Flash® player includes security enhancements.
    Visual Voice Mail Wi-Fi improvements include removal of
    Enhanced support for Yahoo!® IMAP email.Updated Slacker application.
    Attach files larger than 5 MB.Updated COX POP3 email settings.Play YouTube videos in YouTube application.Seamlessly switch between portrait and landscape views inUpdated Comcast POP3 email settings.Search key and other buttons displayed in correct order.
    directly from their devices and bill them to a Verizon Wireless
    account.
    Preinstalled V CAST Apps lets users purchase applications
    http://support.vzw.com/pdf/system_update/incredible.pdf

  • How do I add a file attachment to an e-mail?

    I need to know how to attach a file to an e-mail

    Hi,
    Firefox and other web browsers are only for displaying web pages, web mails etc. All the content comes from the other end ie. web site, web mail provider. To attach a file you may have to use the tools in the mail page, if the mail service provider has such an option.
    If this is related to Thunderbird, please [http://support.mozillamessaging.com/en-US/kb/how-use-attachments?s=attachment&as=s see this] and the [http://support.mozillamessaging.com/en-US/home Thunderbird forum.]
    Useful links:
    [https://support.mozilla.com/en-US/kb/Options%20window All about Tools > Options]
    [http://kb.mozillazine.org/About:config Going beyond Tools > Options - about:config]
    [http://kb.mozillazine.org/About:config_entries about:config Entries]
    [https://support.mozilla.com/en-US/kb/Page%20Info%20window Page Info] Tools (Alt + T) > Page Info, Right-click > View Page Info
    [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard Shortcuts]
    [https://support.mozilla.com/en-US/kb/Viewing%20video%20in%20Firefox%20without%20a%20plugin Viewing Video without Plugins]
    [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder & Files]
    [https://developer.mozilla.org/en/Command_Line_Options#Browser Firefox Commands]
    [https://support.mozilla.com/en-US/kb/Basic%20Troubleshooting Basic Troubleshooting]
    [https://support.mozilla.com/en-US/kb/common-questions-after-upgrading-firefox-36 After Upgrading]
    [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20plugins Troubleshooting Plugins]
    [http://kb.mozillazine.org/Testing_plugins Testing Plugins]

  • How can i send multiple Key note files attached in one e-mail

    I've problem with mail attachment. I want to send multiple files from keynote as 4 attached in one mail. Anyone know how? Do I've to wasting time send it one by one? Your kind advice will be a lot appreciated. Thank you ;)

    You can only email one file at a time from the app. Unless you can copy and paste all four files into the email, you can't do it in the Mail App either. There is a third party app called Group Email with Attachments that will allow you to do this. You will have to be running iOS 4 to attach documents I believe.
    Message was edited by: Demo

  • Why did a file attach itself to sent mail without my clicking the attach button?

    I sent an email that I did not attach anything to. When I checked my sent folder I saw there was an attachment on it. Clicking on the attachment opens the Adobe Reader and says the file is damaged.
    This happened with a gmail address. When I checked it on gmail, there was no attachment.
    Do I have a security problem?

    If you see the message you sent on the server your account must be IMAP. Then it's not possible that you do see something different in Thunderbird than on the server. I guess you left something out in your problem description.
    What kind of file is the actual attachment?

  • Zip file attachment in Apple Mail

    I am new to Mac and Apple Mail. I received a mail with a zip file attached. But Apple Mail shows the attachment as some html text. How do I retrieve and save the zip file?

    some one sent you a zip file and you are having trouble opening it... it shouldn't... but if you do you can down load: http://www.stuffit.com/mac-expander.html
    or http://itunes.apple.com/us/app/stuffit-expander/id405580712?mt=12

  • Mail attachment issues in full screen apps

    This is an interesting issue.  So far it only occurs with MS Excel.  When Mail is open as a full screen app and I open an xlsx file attached to a mail message the screen shifts back over to the desktop screen as it should, but the Excel window remians locked with the Mail full screen app.  At this time, I cannot swipe back over to Mail, it just shifts back over to the desktop screen every time I try.  The only resolution that I have found so far is to quite Mail from my dock icon and relaunch.  This then moves the Excel window to my desktop screen.
    I wonder if this is only an issue with programs that do not suppport full screen apps.
    Thoughts?
    Thanks,
    Marc

    Have you tried toggling - Command, Control, F
    If you do a 5 finger swipe up do you see Apple Mail as it's own desktop?  If so when you expand Apple Mail use the green traffic dot in the upper left side instead of the full screen double arrow on the upper right side.

  • Save Attachment from exchange server 2010 from oracle using java mail API

    Hello,
    I want to read email from microsoft exchangeserver 2010 and save attachement into a folder.I created an Java program to import attachments from a exchange server mailbox using "POP3S".It works fine when run as a java application.But when i put this inside Oracle11g R2 using load java and while executing from a procedure it gives an error at parsing message into Multipart
    Error at line : Multipart mp = (Multipart)m.getContent();
    Error:
    Content-Type: multipart/mixed;
    boundary="_002_A0C2E09A..................................."
    java.lang.ClassCastException
    at mailPop3.checkmail(mailPop3:71)
    My Java Class is as follows,
    import java.io.*;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.Date;
    The function i used to check for attachments is given below.
    public static boolean hasAttachments(Message m) throws java.io.IOException, MessagingException
    Boolean hasAttachments = false;
    try
    // if it is a plain/html text - no attachements
    if (m.isMimeType("text/*"))
    return hasAttachments;
    else if (m.isMimeType("multipart/alternative"))
    return hasAttachments;
    else if (m.isMimeType("multipart/*"))
    Multipart mp = (Multipart)m.getContent();
    if (mp.getCount() > 1)
    hasAttachments = true;
    return hasAttachments;
    catch (Exception e) {
    e.printStackTrace();
    } finally {
    return hasAttachments;
    My Java Details as follows
    java Version :1.5.0_10
    java.vm.specification.version:1.0
    java.vm.version :1.5.0_01
    java.specification.version:1.5
    java.class.version:48.0
    Java mail API:javamail-1.4.4
    Used Jars:mail.jar
    Could someone explain why I am getting this error? What can I do to resolve this error?
    Is any other Jar need other than mail.jar?
    Any help would be much appreciated.
    Regards,
    Nisanth

    Hai EJP,
    Thanks for your reply,
    My full java class as follows,
    import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Folder;
    import javax.mail.Message;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Store;
    import javax.mail.Part;
    import javax.mail.Multipart;
    import javax.mail.internet.MimeMultipart;
    import javax.mail.internet.MimeMessage;
    public class Newmail
    public Newmail()
    super();
    public static int mailPOP3(String phost,
    String pusername,
    String ppassword)
    Folder inbox =null;
    Store store =null;
    int result = 1;
    try
    String host=phost;
    final String username=pusername;
    final String password=ppassword;
    System.out.println("Authenticator");
    Authenticator auth=new Authenticator()
    protected PasswordAuthentication getPasswordAuthentication()
    return new PasswordAuthentication(username, password);
    System.out.println("Certificate");
    String filename="D:\\Certi\\jssecacerts";
    String password2 = "changeit";
    System.setProperty("javax.net.ssl.trustStore",filename);
    System.setProperty("javax.net.ssl.trustStorePassword",password2);
    Properties props = System.getProperties();
    System.out.println("host-----"+props);
    props.setProperty("mail.pop3s.port", "993");
    props.setProperty("mail.pop3s.starttls.enable","true");
    props.setProperty("mail.pop3s.ssl.trust", "*");
    Session session = Session.getInstance(props,auth);
    session.setDebug(true);
    store = session.getStore("pop3s");
    System.out.println("store------"+store);
    store.connect(host,username,password);
    System.out.println("Connected...");
    inbox = store.getDefaultFolder().getFolder("INBOX");
    inbox.open(Folder.READ_ONLY);
    Message[] msgs = inbox.getMessages();
    System.out.println("msgs.length-----"+msgs.length);
    result = 0;
    int no_of_messages = msgs.length;
    for ( int i=0; i < no_of_messages; i++)
    System.out.println("msgs.count-----"+i);
    System.out.println("Attachment....>"+msgs.getContentType());
    Multipart mp = (Multipart)msgs[i].getContent();
    System.out.println("Casting Success" + mp.getContentType());
    catch(Exception e)
    e.printStackTrace();
    finally
    try
    if(inbox!=null)
    inbox.close(false);
    if(store!=null)
    store.close();
    return result;
    catch(Exception e)
    e.printStackTrace();
    return result;
    Please check it
    Regards,
    Nisanth

  • File attachment in yahoo mail does not appeare in Firefox 4, but IE & other web browsers show correctly.

    Before I install Firefox 4, I have been use Firefox 3.6 and when I was checking my yahoo mail, there was not any problem to view or download file attachment.
    After installing Firefox 4, when I receive a new mail with file attachment, like as video, or document, I can not see the attachment to download it. but with other web browsers like IE, I can see the attachment of the email.

    Hi!
    People using a Trend Micro virus scanner should disable some webmail function. You can find the solution [http://en.kioskea.net/forum/affich-33677-can-t-download-attachments-on-my-yahoo-email here]
    I do not use Trend Micro, but have the same issues. I just found my "AdBlock Plus" add-on was stopping the attachment download. What you should do to see if this is your problem too: disable AdBlock Plus, restart firefox and see if your problem is solved. Now enable AdBlock Plus again and restart Firefox.
    To fix this problem: In Firefox, click on Add-ons, go to AdBlock Plus, go to Options, click on Filters--> reset statistics. Go to your attachment, click on the attachment (it will fail to download of course). Go back to AdBlock Plus and sort the statistics for "Hits". Now you can see which filter is blocking your attachment download. Disable this filter and you problem is solved!
    Regards!

  • Attaching files by dragging them to Mail icon creates two emails??

    In Tiger I would always drag files to the Mail app's icon in the dock and Mail would automatically create a new email message with the file attached.
    In Leopard it does that same, but it also creates an additional new email message (without the attachment). That leaves me with two messages open, one with the attachment and one without.
    Has anyone encountered this? Is this a bug or a new "feature" that I can disable in preferences or something?
    Beau

    Well I took the time and sat on the phone with APPPLE CARE for 45 minutes to try to trouble shoot this crazy thing.
    How many of you are using Default Folder X? It turns out that I had to go through my LOG-IN items one by one and I found out that whenever Default Folder X is on (either enabled at log in or manually the issue starts)
    So for my case it Default Folder X is the culprit!!! I turn Default Folder X off, log out and log in again voila mail works fine.
    Just thought I would let you know what worked for me... it would be interesting to know if you guys have that same problem or find other log in items causing the issue.

  • Email Attachement using mail api

    Hi to All,
    Hi i am using mail api for my project with Eclipse in Window xp.I have two doubts .
    1. I want to download attachment with out using file concept.Can i download the attachement
    2.Here i am having attachment in my mail .I want to forward the attachement with out attache again.
    can u help me..
    Thanks...

    Hi Gandalf,
    I picked up your code and ran it, couple of things, firstly windows and Unix line terminations are different so in your method doCommand use "\r\n" not just \n, this will give a full <CRLF>
    On you initial HELO you want to use your computer's id as part of the command so use this line:
    sender_domain = InetAddress.getLocalHost().getHostName();
    String s1 = new String("HELO " + sender_domain);
    s1.trim();
    response = doCommand(s1);
    Cheers
    Dom

  • Sender "Mail" adapter - CSV file attachment

    Hi there
    I'm looking for some help in configuring a sender mail adapter that receives ".csv" files. I did read some blogs that mention using the "PayloadSwapBean" module to read the mail attachment instead of the mail content. My problem is to now convert the ".csv" file into a message. Is there a module that I can use ( is it the "MessageTransfomBean" ) and how. Any help would be appreciated.
    Thanks
    Salil

    Hi Salil,
    If you want to send a mail with a body and attachments, the message sender HAS to provide an XI message with attachments. I doubt a CSV file does justice.
    As Renjith said you need to convert CSV to XmL.
    A short description about the Standard Modules:
    MessageTransformationBean is a standard module used to apply the XSLT mapping to the adapter module by using <i>Transform.class</i> ( This xslt mapping is done to create a mail package, Dont confuse with the actual mapping in your case this is NOT for converting csv to xml).
    Also this module can be used to change the name and type of payloads by using <i>Transform.contentType</i>, <i>Transform.contentDisposition</i>, <i>Transform.contentDescription</i>.
    PayloadSwapbean is a standard module for replacing payloads with other payloads (SWAP)
    If you want to give each attachment a certain name use Parameters, <i>swap.keyname</i> for name of the payload and <i>swap.keyvalue</i>.
    I Hope the use of standard modules is understood.

Maybe you are looking for

  • How can I create a link or reference to an email in my inbox in Mail?

    I want to create links to emails (not links in emails), to be able to access an email directly out of my todo list program (I use Wunderlist). Example: an email requires an action. I create a todo in Wunderlist and I want to add a reference or link t

  • UCM 11g : problem in starting the UCM server

    Hi All, I have started the Managed service for UCm server. when i am hitting the url : http://<IP>:16200/cs it is giving me error "Server is unavailable". and in it's deatils following error is shown: javax.servlet.ServletException: Could not start u

  • Flash Player: Installing Problem with Finding Resources

    I'm having a problem installing Flash Player. It will get 47% complete and stop. The error messages says: "Cannot find Resource". What resource is it looking for? And how can I fix this problem? Please, any help would be greatly appreciated. My compu

  • Authentication problem in Directory Utility (Standard Mode)

    I misposted this in the 10.4-and-earlier section...I have Leopard. Okay, I suppose I am in over my head as I am not a NA but just had so many macs I thought it would be fun to see if I can make OS X Server work. I have at the moment 3 users set up: 1

  • Problem in flat file loading(bulk data)

    Hi, I am populating a flat file with 3lac records. I am getting error due to buffer space problem. "Error during target file write " around 2 lac records are getting inserted after that the above error is coming.. Now temporarily I am populating 1.5