問題:
寄信,使用oracle Stored Procedures Send Mail (函數UTL_SMTP),
且含HTML、中文字碼(內文及標題)
解決:
UTL_SMTP.write_data 放沒中文的資料。
UTL_SMTP.write_raw_data 放有中文的資料。
CREATE OR REPLACE PROCEDURE send_mail
(
v_mail_body IN VARCHAR2 --內文
)
IS
c UTL_SMTP.connection;
lc_mailhost VARCHAR2 (100) := 'mail host';
v_mail_sub VARCHAR2 (200) := 'mail標題';
v_from_email VARCHAR2 (100) := '寄件人';
v_to_email VARCHAR2 (100) := '收件人';
BEGIN
c := UTL_SMTP.open_connection (lc_mailhost, 25);
UTL_SMTP.helo (c, lc_mailhost);
UTL_SMTP.mail (c, v_from_email);
UTL_SMTP.rcpt (c, v_to_email);
UTL_SMTP.open_data (c);
UTL_SMTP.write_raw_data (c, utl_raw.cast_to_raw('Subject:' || v_mail_sub || UTL_TCP.crlf));
UTL_SMTP.write_data( c, 'Content-Type: text/html; ' || UTL_TCP.crlf );
UTL_SMTP.write_raw_data(c, utl_raw.cast_to_raw(utl_tcp.crlf || v_mail_body));
UTL_SMTP.close_data (c);
UTL_SMTP.quit (c);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Mail not sent');
END send_mail;
/
= = = = = = = = = [分隔線] = = = = = = = = =
問題:
我已經灌了 Oracle Client , 但執行 .net 時卻出現
「oramts.無法載入 DLL 'oramts.dll': 找不到指定的模組」
解決:
在硬碟中尋找「MSVCRTD.DLL」,並拷貝至「C:\WINDOWS\system32」
接著重新啟動,即可!
= = = = = = = = = [分隔線] = = = = = = = = =
- Jan 08 Thu 2009 16:03
[Oracle]遇到的問題。慢慢匯整
全站熱搜
留言列表