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
hiswapnaAsked:
Who is Participating?
 
rockiroadsCommented:
0
 
rockiroadsCommented:
I dont have examples handy but what you could make use of is UTL_STMP

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
0
 
rockiroadsCommented:
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(mailhost, 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
0
 
hiswapnaAuthor Commented:
Hello

thanks for the response but how do i send to multiple receipients
0
 
rockiroadsCommented:
for multiple recipients, have a look at this

search for Unable to send HTML to multiple recipients
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.