2 Replies Latest reply on Feb 14, 2010 10:59 AM by Milos Zikic

    Mail Attachment Issue With Some Clients

    Matthew Lueck Newbie

      After releasing an application to production I had reports of users not receiving email.  It seems some email clients have a problem displaying attachments (in this case, PDFs) nested in a multipart/related.  I tried both attachment and inline for content-disposition.  These were mostly web clients. After modifying UIBody.java in seam's mail jar, I was able to view the attachments in those email clients.  The fix was to get rid of the multipart/related and add the content to the email directly:



                  if (findMessage().getAttachments().size() > 0)
                  {
      
                     getRootMultipart().addBodyPart(bodyPart, 0);
      
                     for (MimeBodyPart attachment: findMessage().getAttachments())
                     {
      
                        getRootMultipart().addBodyPart(attachment);
      
                     }
      
                  }else{
      
                      getRootMultipart().addBodyPart(bodyPart, 0);
      
                  }
      



      Has anyone else experienced this problem?  Is this an appropriate solution/