DH,
ada yang bisa membantu untuk script send email (utl_smtp) dengan
attachment binary ( pdf, image, dll ) ?
Saya sudah mencoba, berikut penggalannya :
UTL_SMTP.WRITE_DATA(conn, '-------SECBOUND' || utl_tcp.CRLF);
-- isi dengan text/plain untuk txt, application/octet untuk binary (pdf
) application/pdf image/jpeg
UTL_SMTP.WRITE_DATA(conn, 'Content-Type: application/pdf' ||
utl_tcp.CRLF);
UTL_SMTP.WRITE_DATA(conn, ' name="satu.pdf"' || utl_tcp.CRLF);
-- isi dengan 8bit untuk txt, base64 untuk binary
UTL_SMTP.WRITE_DATA(conn, 'Content-Disposition: attachment;' ||
utl_tcp.CRLF);
UTL_SMTP.WRITE_DATA(conn, ' filename="satu.pdf"' ||
utl_tcp.CRLF);
UTL_SMTP.WRITE_DATA(conn, 'Content-Transfer_Encoding: base64' ||
utl_tcp.CRLF);
UTL_SMTP.WRITE_DATA(conn, '' || utl_tcp.CRLF);
bfile_handle := bfilename('CHKDIR', 'satu.pdf');
len := dbms_lob.getlength(bfile_handle);
I := 1;
dbms_lob.open(bfile_handle,dbms_lob.lob_readonly);
loop
if I + 57 - 1 > len then
read_bytes := len - I + 1;
else
read_bytes := 57;
end if;
dbms_lob.read(bfile_handle,read_bytes,I,data);
utl_smtp.write_raw_data(conn,utl_encode.base64_encode(data));
I := I + 57;
if I > len then
exit;
end if;
end loop;
DBMS_LOB.CLOSE(bfile_handle);
UTL_SMTP.WRITE_DATA(conn, '' || utl_tcp.CRLF);
UTL_SMTP.WRITE_DATA(conn, '-------SECBOUND--' || utl_tcp.CRLF);
UTL_SMTP.CLOSE_DATA(conn);
UTL_SMTP.QUIT(conn);
----------------
Hasilnya : Email terkirim dengan attachment, sizenya benar.
error : attachment tidak bisa dibuka. Encodingnya salah..
Bagaimana cara debug encodingnya, sudah bisa di baca dengan benar ?
--
Herman
------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/PhFolB/TM
--------------------------------------------------------------------~->
--
-----------I.N.D.O - O.R.A.C.L.E---------------
Keluar: [EMAIL PROTECTED]
Website: http://indo-oracle.lizt.org (NEW)
-----------------------------------------------
Bergabung dengan Indonesia Thin Client User Groups,
Terminal Server, Citrix, New Moon Caneveral, di:
http://indo-thin.vze.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/indo-oracle/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/