Click here to Skip to main content
15,895,011 members

Comments by aks87 (Top 2 by date)

aks87 12-Nov-12 3:08am View    
create or replace PACKAGE sendmail_pkg IS

procedure common (p_sender varchar2,
p_recipient varchar2,
p_subject varchar2,
c out utl_smtp.connection);

procedure send (p_sender varchar2,
p_recipient varchar2,
p_subject varchar2,
p_body varchar2 default null);



end sendmail_pkg;

/



create or replace PACKAGE BODY sendmail_pkg AS

procedure common (p_sender varchar2,
p_recipient varchar2,
p_subject varchar2,
c out utl_smtp.connection) is

v_recipient varchar2(1000);
begin

--make connection to smtp
c := utl_smtp.open_connection('10.160.0.1');

--identify the domain of the sender
utl_smtp.helo(c, 'https://mail.tcs.com/owa');

--start a mail, specify the sender
utl_smtp.mail(c, p_sender);

--identify recipient
utl_smtp.rcpt(c, v_recipient);

--start the mail body
utl_smtp.open_data(c);

utl_smtp.write_data(c, 'From: ' || p_sender || utl_tcp.crlf);
utl_smtp.write_data(c, 'To: ' || p_recipient || utl_tcp.crlf);
utl_smtp.write_data(c, 'Subject: ' || p_subject || utl_tcp.crlf);

exception
when utl_smtp.transient_error or utl_smtp.permanent_error then
utl_smtp.quit(c);
raise;
when others then
raise;
end common;

procedure send (p_sender varchar2,
p_recipient varchar2,
p_subject varchar2,
p_body varchar2 default null) is

c utl_smtp.connection;

begin

common(p_sender, p_recipient, p_subject, c);

utl_smtp.write_data(c, 'Content-Type: text/html' || utl_tcp.crlf);
utl_smtp.write_data(c, utl_tcp.crlf || p_body);
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;
when others then
raise;
end send;

end sendmail_pkg;
/




This is code this is compiling as well,,

but i need to know how to change it for getting calender alerts on Lotus notes.
aks87 12-Nov-12 3:08am View    
create or replace PACKAGE sendmail_pkg IS

procedure common (p_sender varchar2,
p_recipient varchar2,
p_subject varchar2,
c out utl_smtp.connection);

procedure send (p_sender varchar2,
p_recipient varchar2,
p_subject varchar2,
p_body varchar2 default null);



end sendmail_pkg;

/



create or replace PACKAGE BODY sendmail_pkg AS

procedure common (p_sender varchar2,
p_recipient varchar2,
p_subject varchar2,
c out utl_smtp.connection) is

v_recipient varchar2(1000);
begin

--make connection to smtp
c := utl_smtp.open_connection('10.160.0.1');

--identify the domain of the sender
utl_smtp.helo(c, 'https://mail.tcs.com/owa');

--start a mail, specify the sender
utl_smtp.mail(c, p_sender);

--identify recipient
utl_smtp.rcpt(c, v_recipient);

--start the mail body
utl_smtp.open_data(c);

utl_smtp.write_data(c, 'From: ' || p_sender || utl_tcp.crlf);
utl_smtp.write_data(c, 'To: ' || p_recipient || utl_tcp.crlf);
utl_smtp.write_data(c, 'Subject: ' || p_subject || utl_tcp.crlf);

exception
when utl_smtp.transient_error or utl_smtp.permanent_error then
utl_smtp.quit(c);
raise;
when others then
raise;
end common;

procedure send (p_sender varchar2,
p_recipient varchar2,
p_subject varchar2,
p_body varchar2 default null) is

c utl_smtp.connection;

begin

common(p_sender, p_recipient, p_subject, c);

utl_smtp.write_data(c, 'Content-Type: text/html' || utl_tcp.crlf);
utl_smtp.write_data(c, utl_tcp.crlf || p_body);
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;
when others then
raise;
end send;

end sendmail_pkg;
/




This is code this is compiling as well,,

but i need to know how to change it for getting calender alerts on Lotus notes.