Using PL/SQL to send alert email error

Hi All ,
This is from one of my earlier posting :
DECLARE
l_mailhost VARCHAR2(64) := 'mail.mycompany.com';
l_from VARCHAR2(64) := '[email protected]';
l_to VARCHAR2(64) := '[email protected]';
l_mail_conn UTL_SMTP.connection;
BEGIN
l_mail_conn := UTL_SMTP.open_connection(l_mailhost, 25);
UTL_SMTP.helo(l_mail_conn, l_mailhost);
UTL_SMTP.mail(l_mail_conn, l_from);
UTL_SMTP.rcpt(l_mail_conn, l_to);
UTL_SMTP.data(l_mail_conn, 'Single string message.' || Chr(13));
UTL_SMTP.quit(l_mail_conn);
END;
and i got this error
ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_SMTP", line 17
ORA-06512: at "SYS.UTL_SMTP", line 96
ORA-06512: at "SYS.UTL_SMTP", line 138
ORA-06512: at line 7
how can i find out exactly what the error means
i think it requires port# 25 to be opened which currently is being blocked by my Mcafee s/w but besides that ??
and also is it possible for me to change the SMTP port to another besides port# 25 ?
apprecaite ur advise
tks & rdgs
View program sources of error stack?

try this , you need to open port 25 and make sure that the machine from where you want to send emails has been allowed to send emails from ur mail server
Procedure PROC_SEND_EMAIL (
i_sender IN VARCHAR2,
i_recipient IN VARCHAR2,
i_message IN VARCHAR2
IS
v_mailhost VARCHAR2(50) :='hostname';
v_mail_conn UTL_SMTP.CONNECTION;
v_message VARCHAR2(10000);
BEGIN
v_mail_conn := UTL_SMTP.OPEN_CONNECTION( v_mailhost, 25 );
UTL_SMTP.HELO( v_mail_conn, '[email protected]' );
UTL_SMTP.MAIL( v_mail_conn, '<'||i_sender||'>' );
UTL_SMTP.RCPT( v_mail_conn, '<'||i_recipient||'>');
v_message := i_message ;
UTL_SMTP.OPEN_DATA( v_mail_conn );
UTL_SMTP.WRITE_DATA(v_mail_conn, 'To: "' || i_recipient || '" <' || i_recipient || '>' || utl_tcp.crlf);
UTL_SMTP.WRITE_DATA(v_mail_conn, 'CC: "' || '[email protected]' || '" <' || i_recipient || '>' || utl_tcp.crlf);
UTL_SMTP.WRITE_DATA(v_mail_conn, 'Subject: ' || '***** Mail From host*****' || utl_tcp.crlf);
UTL_SMTP.WRITE_DATA(v_mail_conn, utl_tcp.crlf);
UTL_SMTP.WRITE_DATA( v_mail_conn,utl_tcp.CRLF ||Chr(13)||v_message||Chr(13)|| utl_tcp.CRLF || '****This e-mail was generated By the application do not reply****' );
UTL_SMTP.CLOSE_DATA( v_mail_conn );
UTL_SMTP.QUIT( v_mail_conn );
EXCEPTION
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
utl_smtp.quit(v_mail_conn);
raise_application_error(-20005,
'Failed to send mail due to the following error: ' || sqlerrm);
WHEN OTHERS THEN
raise_application_error(-20001, 'The following error has occured: ' || sqlerrm);
END PROC_SEND_EMAIL ;

Similar Messages

  • Using BI publisher to send alert to dynamically generated email

    Hello,
    Good afternoon.
    Please I will like to know if its possible to use Oracle BI publisher to send alert to dynamically generated email in real time online basis ?
    If yes please can I have an idea of how this can be achieved ?

    Hi,
    Go through this...http://oraclebizint.wordpress.com/2008/02/01/oracle-bi-ee-101332-calling-bi-publisher-java-apis-from-ibots-storing-reports-in-file-system-using-delivers-and-bi-publisher-scheduler/
    Regards,
    Srikanth

  • How to send alert email notification through graphical mapping ?

    Hi,
    I want to send an email notification whenever there is an exception raised while doing graphical mapping.
    However my requirements are as follows :
    1. We want to use email adpater sending emails
    2. We don't want to go for BPM approach, to achieve the above requirement
    3. We don't want to connect to any alert framewok.
    I appreciate your early reply.
    Thanks
    Ganesh

    Hey
    >>whenever there is an exception raised while doing graphical mapping.
    as said earlier this is not possible without configuring alerts.
    yeah,if u know the reasons beforehand that why exceptions can be be triggered in mapping,then u can use conditional receiver determination,for e.g suppose u know that you will get a mapping exception if value of tag <OrdersID>=000,then u can use this condition in conditional receiver determination and send a mail to concerned party,but this won't work if u don't know beforehand as to under what conditions the exception will be  triggered in mapping.
    i would vote for configuring alerts as its the most suited way to handle this
    thanx
    Aamir

  • How to use Apple Mail to send outgoing emails only?

    Hello,
    I haven't been able to find exactly what I'm looking for elsewhere on the interwebs.
    I want to be able to set up the Apple Mail app on my Mac to send outgoing emails only from my Gmail account. I use the Gmail website and my iPhone for sending/receiving emails and I don't want or have a need for all of my Gmail emails to be downloaded into the Apple Mail app or for new emails to appear in the Mail app as they come in.
    I just want to be able to send outgoing emails from the app so that I can send photos directly from iPhoto using the Email button. Any help is greatly appreciated!

    Great news, thanks!

  • When I send an email -error message says can't save in folder

    my sent emails don't save in the sent folder. When I click send for a new email ... I get an error message that says it can't save to the sent folder. Just started using TB yesterday.

    I have a similar problem, except my progress bar never ends. The last thing I should read is message to saved in sent folder. If I close the window, the message does not appear in the sent folder. I have to tell you I have been using Thunderbird for several years now. As of yesterday, it was working fine. Now it isn't and this has left me scratching my head.
    stevecc

  • Using Previous Recipients to Send New Email

    Im wondering...I have a very long list of previous recipients. I am now working on a mass email that I would like to send (bcc'd, of course!) to about half of them.
    I tried to highlight the names/emails that I want to use and drag them to the bcc field, but this failed. Is there no drag and drop from the previous recipients list?I don't want to add these people to my address book, just send them a single email without having to type each address out by hand.
    Can this be done?
    Thanks for any help...

    no, there is no way to mass drag them off the previous recipients list.
    see this post how to extract them and put them in a text file. you can copy and paste from there.
    http://discussions.apple.com/thread.jspa?threadID=1695676&tstart=0
    but keep in mind that most ISPs will block emails with huge numbers of recipients so if the list is truly massive you may want to reconsider sending a single email.

  • Sending any email - error message 'exceeded their send quota'

    An error occurred while sending mail. The mail server responded: User [email protected] has exceeded their send quota. Please verify that your email address is correct in your Mail preferences and try again.
    I've uninstalled/reinstalled TB. Removed and added the email account, tried multiple out port combinations of 25,80 and 3535' checked online at godaddy and can send mail just fine, no quota's exceeded, plenty of hard drive space, threw away all emails, in and sent. This is my POS computer and we need it working! Please don't make me go back to Outlook!!!!
    Running - 2009 Windows 7 Home Premium; Service Pack 1 - Dell PC

    Thunderbird does not set quotas. Email providers do. Ask them.

  • Sending alert emails from SharePoint

    Hi all,
    I'm having trouble sending emails from SP 2013. Can someone explain me in detail how to connect SP 2013 with Exchange 2010? The CRM and Exchange are located on two different servers.
    Vlastimir Sindelic

    With Exchange 2010, what you want is an Anonymous Receive Connector. In SharePoint, under Central Admin -> System Settings -> Outgoing email settings, you would specify the DNS name for the IP that is tied to the Anonymous Receive Connector.
    Based on the defaults, you will need to add a second IP address to the Exchange server in order to support the Anonymous Receive Connector, and bind the Connector to that IP address.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • I am no longer able to send any emails - error message below. I've not changed any settings

    error message
    An error occurred while sending mail. The mail server responded: 5.7.0 Must issue a STARTTLS command first. b2sm21368719wiz.15 - gsmtp. Please verify that you

    https://support.mozilla.org/en-US/kb/cannot-send-messages

  • Sql server agent alert is not sending a mail

    1. sql server agent alert is not sending a mail .I have configure it for sql server event alert and error number 14151 and in "Raise alert when messaging contains" check box I have set: Replication Distribution Subsystem: agent
    2. Sql server agent is restarted also.All database mail and other settings are Ok.
    Still I m not getting mail
    Thanks

    Hi Ajay,
    You can test the connectivity with any server who has smtp access and execute osql to send email to required people.
    Below command can be put into bat file and named as DB_MirrorAlert.bat
    osql -U XXXX -P XXXXX -S Test123 -h-1 -s "|" -w 50 -n -i E:\DBscript_Santosh\DB_MirrorAlert.sql > E:\DBscript_Santosh\DB_MirrorAlert.csv
    OR
    osql -E -S Test123 -h-1 -s "|" -w 50 -n -i E:\DBscript_Santosh\DB_MirrorAlert.sql > E:\DBscript_Santosh\DB_MirrorAlert.csv
    In above command, you are connecting to a server where db email works fine for you and then you are executing a script wherein you can put alert for success or failure like below:
    Success Alert:
    Create a success alert file named as DB_MirrorAlert.sql as you are calling above in bat file and put all scripts in one folder.
    use master
    Go
    EXEC msdb.dbo.sp_send_dbmail
        @profile_name='Profile One',
    @recipients =
    XXX,
    @subject  = 'DB Mirror Server Failed over',
    @body = '
    'DB Mirror Server Failed over to Server B'
    Now you can do this after checking that any one of the server is  not responding or by checking system store procedures too. Good link about monitoring is mentioned below:
    http://msdn.microsoft.com/en-IN/library/ms190030.aspx
    Let me know if you need any more assistance at my end.
    Santosh Singh

  • Error 1172 occurred when sending smtp email via labview

    I found these two useful vi example to send smtp email using Labview:
    http://decibel.ni.com/content/docs/DOC-7451
    http://decibel.ni.com/content/docs/DOC-2401
    However, I got error 1172 saying "No connection could be made because the target machine actively refused it 74.125.91.109:587". I'm using gmail to send emails and pretty sure that all the settings in the VI are correct. According to http://mail.google.com/support/bin/answer.py?answer=13287, I tried both 587 and 465 as the port, and nothing would help. 587 will give the 1172 error and 465 will hang the vi for a while after stopping it. This 1172 error is unlikely due to the suggestion from the 2nd link, "Note: If you receive Error -1172 with this example, try logging into the Gmail account with your browser.  This error can occur with Gmail accounts that have been inactive for a period of time.  You must log in with a browser and verify CAPTCHA text to reactivate the account." because the error kept on even when I login to my gmail account.
    I got myself a solution from http://stackoverflow.com/questions/2737823/unable-to-send-smtp-mail-with-net-network-issue, which says to turn off the antivirus software. I turned off McAfee on my PC and it did work. Now, I'm able to send email, even when I log out my account. However, I'm not happy since I have to keep my antivirus off. My question is, is there any way to walk around this issue? i.e. being able to send email with antivirus on?
    My 2nd question: how to send message to multiple recipients? The string array to the "recipient" does not work, and the form of "[email protected];[email protected]" does not work neither. Do I have to create multiple property nodes for the recipients or better way to do it?
    Many thanks 
    Message Edited by holyna on 06-14-2010 11:34 PM

    Hi Bhuvanesh,
    I noticed that the original thread here hasn't been updated in over a year. In the future, it will be helpful if you begin a new topic for your issue.
    I will first address your second question concerning sending SMS messages using LabVIEW. The only way LabVIEW can send an SMS text message is by passing an e-mail to the appropriate SMS gateway service. This gateway will vary by cellular provider. You will need to obtain the SMS gateway service information for each carrier you wish to push text messages to. 
    As far as the error you are receiving, we will need more information in order to narrow down your problem. What is the exact error message you're receiving? Are you receiving "1172: No connection..." or some other variation? A screen capture of your code would also be very useful.
    Regards,
    Andy C.
    Applications Engineering
    National Instruments

  • Send Alerts(e-mail) for errors in SXMB_MONI(message mapping exceptions)

    Good afternoon !
            I´m configuring SAP Netweaver PI 7.0(SP13) to use Alert Framework to send Alerts when errors occurs in the interfaces processing.
            I just achieved configure to send alerts when errors ocurrs in the Adapter Framework but, I can´t configure correctly to send alerts when errors ocurred only in SXMB_MONI(for example, message mapping exception in asyncronous interface).
            I just followed the instructions at Michal Krawczyk
    weblog(/people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step) and, initially, this was not sufficient to start to send alert when errors occurs only on SXMB_MONI, so, I researched and found some configurations to do in CCMS(started from here: http://help.sap.com/saphelp_nw70/helpdata/en/e3/bf3b7a8ccb8040b638ff732c551aeb/content.htm), jobs to start events collectors, etc, and after this, I could see a mail for an message mapping exception. BUT, this message, sent from CCMS to ALM, doesn´t carry out all the message parameters, like message Id, sender(service, interface), receiver(service, interface), that is very important to help to find the message with errors to be solved.
            There is somebody here that already done the Alert configuration to send messages for errors found only in SXMB_MONI(Monitor for processed XML Messages) ?
            There is a better way to achieve this ?
            Thank you for your attention,
            Wilson Rodrigo dos Santos
            SAP Netweaver XI/PI Consultant

    Hi
    Go through these links and follow it.
    ALERTS CONFIG AND STUFF
    http://help.sap.com/saphelp_nw04/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/49/cbfb40f17af66fe10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/49/cbfb40f17af66fe10000000a1550b0/frameset.htm
    XI: Alerts - Step by step
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    http://help.sap.com/saphelp_nw04s/helpdata/en/d0/d4b54020c6792ae10000000a155106/frameset.htm
    Triggering by Calling a Function Module Directly.
    /people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function
    Alerts with variables from the messages payload (XI) u2013 UPDATED
    /people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated
    Simple Steps to Get Descriptive Alerts from BPM in XI
    /people/community.user/blog/2006/10/16/simple-steps-to-get-descriptive-alerts-from-bpm-in-xi
    Triggering XI Alerts from a User Defined Function
    /people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function
    Throwing Smart Exceptions in XI Graphical Mapping
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    /people/sukumar.natarajan/blog/2007/01/07/how-to-raise-alerts-from-abap-proxy
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide
    /people/sravya.talanki2/blog/2006/11/22/error-handling-framework-xiout-of-the-box-episode-1
    /people/ginger.gatling/blog/2005/06/16/integrating-alerts-into-uwl--its-no-problem
    /people/aravindh.prasanna/blog/2006/02/20/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part-3
    /people/aravindh.prasanna/blog/2005/12/24/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part-2
    /people/aravindh.prasanna/blog/2005/12/23/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part--1
    http://help.sap.com/saphelp_nw2004s/helpdata/en/56/d5b54020c6792ae10000000a155106/content.ht
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/abb2e7ff6311d194c000a0c93033f7/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    check this links.
    https://www.sdn.sap.com/irj/sdn/forums
    Trouble shooting Alert configuration:
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide
    /people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions
    Alert Inbox
    http://help.sap.com/saphelp_nw04/helpdata/en/80/942f3ffed33d67e10000000a114084/frameset.htm
    Alert Notification Step-by-Step
    http://help.sap.com/saphelp_nw04/helpdata/en/49/cbfb40f17af66fe10000000a1550b0/frameset.htm
    Defining Alert Classifications
    http://help.sap.com/saphelp_nw04/helpdata/en/49/cbfb40f17af66fe10000000a1550b0/frameset.htm
    Triggering Alerts
    http://help.sap.com/saphelp_nw04/helpdata/en/49/cbfb40f17af66fe10000000a1550b0/frameset.htm
    Setting up alerts
    Setting up alerts in RZ20
    Alert Management
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e04141e8-0f11-2a10-adaa-9d97b062c2df
    Alert Notification
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90f449a8-a6db-2910-a386-d2b5999f5751
    /people/matt.kangas/blog/2006/06/27/personalized-alert-delivery
    Thanks
    Saiyog

  • I have BIS but can't surf, send/receive email, use apps

    i have BB Curve 8520. My BIS was running smoothly (sending and receiving emails real time and surfing the net through BIS), until i noticed when i tried to reply to an email that came in, it won't send. i noticed that it's fluctuating. i was able to send the email after a few minutes... then a few minutes later, i received a replied email from my friend, and when i tried to send my reply, i wasn't able to. also, i can't surf using the browser with the "internet browser" as default. i tried using my wifi and then suddenly all my emails started coming in, all emails that were not able to go through hours ago. my big question was why do i need to turn on wifi just to receive emails. but since i had my BIS for 2 months now, i can send and receive emails and surf through BIS itself without turning on the wifi.  also, i can't use any of my apps like facebook, twitter, yahoo messenger, etc.  They used to work fine with BIS... but now, i have to turn on the wifi connection, so i could log in with them.  aren't these supposed to be running through BIS only?
    I have GPRS on top, not gprs. my carrier says i have active data plan/BIS. but under Services Status..it says Blackberry Internet Service:  Connection:  not connected...
    so, i wiped out my BB and deleted all third party apps. when this was done, i received emails telling me "Your handheld has been registered with the wireless network" and even got "Activation Server" emails telling me that the emails that i have previously set up are now up and running. so i thought my BB is now ok.. i tried surfing, it was okay. after like about 5 minutes, it was down again. tried sending email but can't... i turned on the wifi and boom! the emails started coming in again.i have the Host Routing Tables and my Service Books in my BB. I have GPRS (not gprs) on top which means i have active BIS.  i have registered my HRTs several times... and resending my service books... same thing...
    the big mystery is when i turn on the wifi, the emails suddenly go through and i can send emails. i can open apps that used to only run on BIS. this is ok i guess, but i could never do any of these if i'm not connected to wifi.
    my sister and i have the same BB... i removed my sim and inserted it to her BB and the BIS worked fine... i was able to surf and use apps.. but when i put my sim back on my phone, the problem still exists.  i even used a different sim card that is also subscribed to BIS/data plan, and it still has the same problem... my guess is my carrier is right that my data plan is working ok and that my handheld itself has the problem... 
    i updated my OS, same problem.. wiped it out... used BBSAK, reinstalled OS... numerous battery pulls... same thing... i can receive the HRTs and service books, but after that can't do anything else like i used to... (send/receive emails, use apps like facebook, twitter, ym, etc., can't surf with internet browser - except when wifi is on everything else work fine even emails and apps).. 
    i would really appreciate your help guys.. thanks!

    Hi tarifiq and welcome to the BlackBerry Support Community Forums!
    Can you send me a private message with your PIN so I can check this out for you?
    Thanks
    -CptS
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Send alert as email to user in ECC

    Hi Guys,
    I have to send the alert as email to a user in ECC.
    I do not have that user in PI, so how do I define the recipients?
    Regards,
    Teja

    Hi Teja,
    To send an alert email we should have atleast one communication user in PI. Please see the below discussion.
    Sending alert email to non-PI user
    Regards,
    Priyanka

  • PO to supplier using external send option email (to multiple addresses)

    Hello All,
    We have activated PO external send option for our client but they want that PO should be sent to more than one ID of the supplier and it seems that is not possible by maintaining multiple addresses in Vendor Master's Address view as system only picks one having indicator ticked, also system does not allow to tick it for more than one address. Please let me know if it is possible using standard function to send PO email to more than one address.
    I need to know if there is any standard way of doing this w/o using any development or ABAP work.
    Also has anybody tried using disctribution list SO15 if it is possible?
    Please help we are at Go live.
    Regards
    Anjan
    Edited by: Anjan Dubey on Aug 12, 2009 10:28 AM

    Hi,
    From my opinion, it's impossible of the standard function in SAP system, so:
    Firstly you need to confirm with your buyers, whether they really require to send the information to multiple addresses, maybe they can send the information to one contact person on vendor side, then the contact person can forward the email to other relevant people;
    If have to do it, you need to develope an ABAP background job to do it!
    Hope you can solve the problem!
    Good luck
    Tao

Maybe you are looking for