4 Replies Latest reply on Jul 20, 2009 4:39 PM by mdesignz

    Need Help in attaching pdf to default email client

      In continuation to earlier mail....
      I need to generate a pdf and attach that pdf when ever user clicks on the email hyperlink  in the next page by opening a new window with default email client.


      i am able to generate the pdf but unable to attach.
      i know how to open a mail window using mailto: option but doesn't know how to attach the generated pdf.....

        • 1. Re: Need Help in attaching pdf to default email client
          mdesignz

          Check the 'mail' example in the Seam source distribution.  I believe it covers exactly what you're looking for.

          • 2. Re: Need Help in attaching pdf to default email client
            nickarls

            Well, you can generate and send the attachment with seam mail but I'd be surprised if anyone can provide you with a solution that launches the default mailer with a pre-set attachment. It's too client-side.

            • 3. Re: Need Help in attaching pdf to default email client
              cash1981

              This is how our template looks like.
              All you will have to make sure of is to use the m:attachment tag, and make sure the value is a byte array.


              <m:message xmlns="http://www.w3.org/1999/xhtml"
                  xmlns:m="http://jboss.com/products/seam/mail"
                  xmlns:h="http://java.sun.com/jsf/html">
              
                  <m:from name="#{currentUser.name}" address="#{currentUser.fromEmail}" />
                  <m:to name="#{currContact.name}">#{currContact.email}</m:to>
                  <m:subject>Subject goes here</m:subject>
                  <m:attachment value="#{attachmentMailer.attachedFileData}" contentType="appl
              ication/pdf" fileName="#{attachmentMailer.attachedFileName}"/>
              
                  <m:body>
                      <p>Hello,</p>
                      <p>Blatti blatti, your attachment is</p>
                  </m:body>
              </m:message>



              Hope this helps

              • 4. Re: Need Help in attaching pdf to default email client
                mdesignz

                I think he wants his default mail client to pop up with the PDF doc already set as an attachment.  Adobe Reader does this.