我創建一個Oracle觸發器在數據庫表 後插入或更新數據發送郵件插入數據後發送郵件,但沒有發生創建Oracle觸發器在表
`ORA-24247: network access denied by access control list (ACL)
`ORA-06512: at "SYS.UTL_TCP", line 17`
`ORA-06512: at "SYS.UTL_TCP", line 246`
`ORA-06512: at "SYS.UTL_SMTP", line 127`
`ORA-06512: at "SYS.UTL_SMTP", line 150`
`ORA-06512: at "TEST.SCRIPT_MAIL", line 9`
`ORA-04088: error during execution of trigger 'TEST.SCRIPT_MAIL'
一個錯誤,我使用這個代碼
`CREATE OR REPLACE TRIGGER TEST.SCRIPT_MAIL
AFTER INSERT
ON TEST.PARTY_EMAIL
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
v_From VARCHAR2(80) := '[email protected]';
v_Recipient VARCHAR2(80) := '[email protected]';
v_Subject VARCHAR2(80) := 'test subject';
v_Mail_Host VARCHAR2(30) := '<my domain>';
v_Mail_Conn utl_smtp.Connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
BEGIN
v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 587);
utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
utl_smtp.Mail(v_Mail_Conn, v_From);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
utl_smtp.Data(v_Mail_Conn,
'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
'From: ' || v_From || crlf ||
'Subject: '|| v_Subject || crlf ||
'To: ' || v_Recipient || crlf ||
crlf ||
'some message text'|| crlf || -- Message body
'more message text'|| crlf
);
utl_smtp.Quit(v_mail_conn);
EXCEPTION`
WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
raise_application_error(-20000, 'Unable to send mail', TRUE);
END;`
如何解決呢 請幫助
檢查網絡防火牆.....用戶權限 –
如何檢查網絡防火牆........ ...在我的系統中 – Deepak
只要您的數據良好並且正常工作,您可以嘗試暫時禁用您的Windows防火牆。 –