?
Solved

Sending mail in oracle to multiple receipients

Posted on 2006-04-03
5
Medium Priority
?
1,460 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:hiswapna
  • 4
5 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 16358494
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
 
LVL 65

Expert Comment

by:rockiroads
ID: 16358520
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
 

Author Comment

by:hiswapna
ID: 16358522
Hello

thanks for the response but how do i send to multiple receipients
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 16358961
for multiple recipients, have a look at this

search for Unable to send HTML to multiple recipients
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 375 total points
ID: 16358963
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Six Sigma Control Plans

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question