yyy62103
yyy62103

Reputation: 81

Send Image (jpg/png) as an attachment to mail | UTL_MAIL

I am stuck not getting how do I send mail with Image as an attachment via UTL_MAIL

I am uploading the attachment to below table via ORACLE APEX 20.x

Table : my_attachment

create table my_attachment
(
    my_file_clob blob,
    mimetype varchar2(255 char),
    file_name varchar2(255 char),
    created_date date 
);

My code :

DECLARE

    my_file_name VARCHAR2(255 CHAR);
    my_mime_type VARCHAR2(255 CHAR);
    
BEGIN
    SELECT
        fname
    INTO my_file_name
    FROM
        my_attachment
    WHERE
        create_date = '12-FEB-22';

    SELECT
        fmime
    INTO my_mime_type
    FROM
        my_attachment
    WHERE
        create_date = '12-FEB-22';

    sys.utl_mail.send_attach_varchar2(
    
    sender => 'xyz.outlook.com',
    subject => 'Testing image attachment', 
    message => 'Hi All checking Image attachment', 
    mime_type => my_mime_type, 
    att_file_name => my_file_name);

END;

Error :

ORA-06550 : line 15, column 3:
PLS-00306 : wrong number or types of arguments in call to 'send_attach_varchar2'
*Cause     : Compliation error 
*Action

Upvotes: 0

Views: 249

Answers (0)

Related Questions