Forum Stats

  • 3,872,065 Users
  • 2,266,376 Discussions


Send mail with attachment from a Module in Forms 10g

Hafed Benteftifa
Hafed Benteftifa Member Posts: 167 Green Ribbon
edited Oct 21, 2008 9:04AM in Forms

An interesting email with attachments case if someone has a better solution.

Form module is called. Let's call it INVOICE_MOD. User enters a new invoice and then can either choose to PRINT or MAIL the invoice.
If user clicks on PRINT button, a PDF is generated (thru report server 10g) and user can either physically print the invoice or save the invoice on his desktop.
If user clicks on MAIL button, an email should be sent to client. The email should contain the following:
-From, to, subject, body and the invoice attached as PDF.

Please make not of the last requirement, that is the invoice that was created should be attached to the email as PDF.

Restriction: we can not store anything on the application server although we can manipulate the reports server cache.

Solution that was implemented makes use of BLOBs where the pdf is stored in a table before being sent.
See Metalink NOTE:330146.1 and 70110.1. also has some interesting implementations.
I also went thru the JAVAMAIL bean but this requires attachments on the client side.

Thanks for any input.



  • InoL
    InoL Member Posts: 10,179 Blue Diamond
    edited Oct 20, 2008 3:04PM
    If you install Javamail in the database, you can use the BLOB as source of the attachment. See some examples on [Ask Tom|]
  • 665887
    665887 Member Posts: 96
    You can use the Mail type distribution in reports.
    Give REPORT_DESTYPE as mail,REPORT_DESFORMAT as pdf and REPORT_DESNAME as receipt email.
    from address, subject and cc can be added as a parameters in ur parameter list.
  • Hafed Benteftifa
    Hafed Benteftifa Member Posts: 167 Green Ribbon
    Thanks to both for your suggestions.

    Yes, I tried the MAIL option when using the report. However, this allows only the from, cc and pdf to be sent. BODY of the email is not taken into account.

    For the JAVAMAIL option, I tried it but the solution works against what the DBA allows us to put in the database.

    I will be trying the report option with a distribution.xml file. This way, I should be able to control what goes into the email.
This discussion has been closed.