Issue with UTL_MAIL.SEND_ATTACH_RAW function sending mail with attachment using EDB postgres

295 views Asked by At

I am using the function SEND_ATTACH_RAW to send a mail with an attachment:

UTL_MAIL.SEND_ATTACH_RAW( 
    sender=>v_sender,
    recipients=>v_recipients,
    cc=>NULL,
    bcc=>NULL,
    subject=>'foto',
    message=> 'foto de prueba',
    mime_type=> 'text/plain; charset=us-ascii',
    priority=>3,
    attachment=>import_binary_file('/tmp/IMG_20220127_173051147.jpg'),--this function load binary as bytea
    att_inline=>TRUE, 
    att_mime_type=>'image/jpg',
    att_filename=>'test.jpg');

And work well, but the attachment file name that I receive is named 'noname', please can you help to solve this issue with the name, I would like to receive the att_filename value

Version:

 PostgreSQL 14.2 (EnterpriseDB Advanced Server 14.2.1) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit

1

There are 1 answers

0
psaraj12 On BEST ANSWER

To the benefit of all, I have posted it as a solution. Try using

 att_inline => FALSE

I have suggested this solution based on the oracle MOS document below which will be applicable to EDB Postgres as well.

How to Send Any Type of Attachment with UTL_MAIL (Doc ID 946811.1)