DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Send to multiple email addresses

  1. #1
    Join Date
    Jan 2000
    Posts
    387

    Question

    Hi,

    I am able to send to multiple email addresses using the utl_smtp utility. However, if one of the email addresses is invalid, it will jump to the exception and will not send to any of the other valid addresses. Is there anyway of outcoming it?

    If one of the addresses is invalid, it is possible for it to send a mail to my email address to notify me? Below is my send email procedure. Pls help! thanks!

    CREATE OR REPLACE PROCEDURE send_email (
    sender IN VARCHAR2,
    recipient IN VARCHAR2,
    subj IN VARCHAR2,
    message IN VARCHAR2)
    IS
    mailhost VARCHAR2(30) := 'dbasupport.com';
    c utl_smtp.connection;
    BEGIN
    c := utl_smtp.open_connection(mailhost,25);
    utl_smtp.helo(c, mailhost);
    utl_smtp.mail(c, sender);
    utl_smtp.rcpt(c, recipient);
    utl_smtp.open_data(c);
    utl_smtp.write_data(c, utl_tcp.CRLF || message);
    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;

  2. #2
    Join Date
    Jan 2000
    Posts
    387

    Angry Invalid email address

    Hi,

    I have did several testing and I realised that unless the email address is totally invalid such as xx@xx.com else oracle smtp will still consider the procedure as successful! There is not way to know if the mail was bounced or not! even email address with spelling mistakes can also be proceeded! Any way of detecting those invalid email addresses and a bounce mail unsent like what we normally get from our mailbox if our mail was not being sent successfully please? Thanks a lot!

  3. #3
    Join Date
    Apr 2001
    Posts
    51
    As regards sending mails on multile email address,
    one way could be by using CC and BCC options os utl_smtp package.

  4. #4
    Join Date
    Jan 2000
    Posts
    387

    Arrow

    Thanks! I am aware of the cc and bcc funcation available. My main concern now is how do I capture any bounced mail and verify that it is a correct email address or not. Any other help please? Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width