2026-03-12 20:23:15

This commit is contained in:
root
2026-03-12 21:23:47 +01:00
parent eab4b36eca
commit 93039b8489
3332 changed files with 699614 additions and 0 deletions

28
vg/utl_smtp.sql Normal file
View File

@@ -0,0 +1,28 @@
DECLARE
c Utl_Smtp.connection;
PROCEDURE send_header(NAME IN VARCHAR2, HEADER IN VARCHAR2) AS
BEGIN
Utl_Smtp.write_data(c, NAME || ': ' || HEADER || Utl_Tcp.CRLF);
END;
BEGIN
c := Utl_Smtp.open_connection('192.168.1.10');
Utl_Smtp.helo(c, 'vishalgupta.co.uk');
Utl_Smtp.mail(c, 'vishal@vishalgupta.co.uk');
Utl_Smtp.rcpt(c, 'vishal@vishalgupta.co.uk');
Utl_Smtp.open_data(c);
send_header('From', '"Sender" <vishal@vishalgupta.co.uk>');
send_header('To', '"Recipient" <vishal@vishalgupta.co.uk>');
send_header('Subject', 'Hello');
Utl_Smtp.write_data(c, Utl_Tcp.CRLF || 'Hello, world!');
Utl_Smtp.close_data(c);
Utl_Smtp.quit(c);
EXCEPTION
WHEN Utl_Smtp.transient_error OR Utl_Smtp.permanent_error THEN
Utl_Smtp.quit(c);
RAISE_APPLICATION_ERROR(-20000,
'Failed to send mail due to the following error: ' || SQLERRM);
END;
/