hiswapna
asked on
Sending mail in oracle to multiple receipients
I am using 8.1.6 oracle database and I would like to send a mail to mutiple receipients with attachement. How do i acheive this. Where can i get the sample code for this
urm, spelling mistake. thats UTL_SMTP
For multiple recipients, if not catered for by UTL_SMTP, I guess you can delimit names with semi colons when specifying who to send to.
An example dug up from searchtarget.oracle.com
CREATE OR REPLACE
PROCEDURE
send_mail (sender IN VARCHAR2,
recipient IN VARCHAR2,
message IN VARCHAR2,
nStatus OUT NUMBER)
IS
mailhost VARCHAR2(30) := 'email.hai.iec.co.il'; -- host mail addr
mail_conn utl_smtp.connection;
BEGIN
nStatus := 0;
mail_conn := utl_smtp.open_connection(m ailhost, 25);
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, sender);
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.data(mail_conn, message);
utl_smtp.quit(mail_conn);
EXCEPTION
WHEN OTHERS THEN
nStatus := SQLCODE;
END send_mail;
/
Regarding attachments. Ive not done it but have a look at this http://home.clara.net/dwotton/dba/oracle_smtp.htm
For multiple recipients, if not catered for by UTL_SMTP, I guess you can delimit names with semi colons when specifying who to send to.
An example dug up from searchtarget.oracle.com
CREATE OR REPLACE
PROCEDURE
send_mail (sender IN VARCHAR2,
recipient IN VARCHAR2,
message IN VARCHAR2,
nStatus OUT NUMBER)
IS
mailhost VARCHAR2(30) := 'email.hai.iec.co.il'; -- host mail addr
mail_conn utl_smtp.connection;
BEGIN
nStatus := 0;
mail_conn := utl_smtp.open_connection(m
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, sender);
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.data(mail_conn, message);
utl_smtp.quit(mail_conn);
EXCEPTION
WHEN OTHERS THEN
nStatus := SQLCODE;
END send_mail;
/
Regarding attachments. Ive not done it but have a look at this http://home.clara.net/dwotton/dba/oracle_smtp.htm
ASKER
Hello
thanks for the response but how do i send to multiple receipients
thanks for the response but how do i send to multiple receipients
for multiple recipients, have a look at this
search for Unable to send HTML to multiple recipients
search for Unable to send HTML to multiple recipients
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you going to send via PL/SQL procedures I assume
here are some example sites that demonstrate use of it
http://www.oracleutilities.com/Packages/utl_smtp.html
http://www.psoug.org/reference/utl_smtp.html
http://www.quest-pipelines.com/newsletter-v2/smtp.htm