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)
mailhost VARCHAR2(30) := 'dbasupport.com';
c := utl_smtp.open_connection(mailhost,25);
utl_smtp.write_data(c, utl_tcp.CRLF || message);
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
'Failed to send mail due to the following error: ' || sqlerrm);
Invalid email address
I have did several testing and I realised that unless the email address is totally invalid such as email@example.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!
As regards sending mails on multile email address,
one way could be by using CC and BCC options os utl_smtp package.
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!
Click Here to Expand Forum to Full Width