Email not sent by INSERT trigger with utl_mail

Hello
I have a trigger that is sending an e-mail whenever a particular column (ATTRIBUTE11) is inserted with the value or updated.
E-mail should be sent when the table (ATTRIBUTES) is inserted with a value of ATTRIBUTE11 (IE, ATTRIBUTE11 is not null)
An email must not be sent on the update of the same value in this column (former. ATTRIBUTE11 = new. ATTRIBUTE11) and also an email must not be sent if the table is inserted without value in ATTRIBUTE11

ATTRIBUTES of table has a structure:
Account varchar2 (20);
Attribute11 varchar2 (20);
user_name varchar2 (20);

Triggering factor:
CREATE OR REPLACE TRIGGER "TPP_SND_EMAIL".
AFTER INSERTION OR UPDATE OF ATTRIBUTE11
ON GENEVA_ADMIN ATTRIBUTES.
REFERRING AGAIN AS NINE OLD AND OLD
FOR EACH LINE
WHEN)
OLD. ATTRIBUTE11 <>NEW. ATTRIBUTE11
)
DECLARE
MSGBODY varchar2 (50);
BEGIN
() UTL_MAIL. Send
sender = > "hemanth11"yahoo.co.in"
recipients = > "[email protected]"
subject = > "Test mail through utl_mail.send."
message = > msgbody,.
mime_type = > ' text/plain '.
);
EXCEPTION
WHILE OTHERS THEN
dbms_output.put_line (' error: ' |) SQLERRM);
END TPP_SND_EMAIL;
/

* One Email is not sent whenever a new row is inserted in this table whose value ATTRIBUTE11 (this happens). *
The trigger is activated an email successfully each time an update happens on the column.

Do we not have an option to manage the when clause differently for INSERT and UPDATE differently or is theer a way to manage the same in the trigger above.

Please help me in this regard.

Published by: user13321434 on July 7, 2010 06:19

user13321434 wrote:

I need to send an email, even if the transaction rolls back, makes my job easier it

It is always wrong.

What happens if this code UTL_MAIL ends up with slow network response or an SMTP server overloaded? What happens if the SMTP server is down and the mail cannot be sent? What happens to the transaction then?

Your code is involved not only with the execution of the transaction, but also the integrity of the transaction. It is absolutely not a single justification for this approach to coding a ULT_MAIL delivery within a trigger. Is bad.

The right approach creates a notification or an event to create and deliver an e-mail message. Where the process that will make this event or act on this notification
(a) may have retry mechanisms for mail failures
(b) has no impact in any way shape or form on the transaction that created the event or notification

Violate this fundamental principle to your own (and the base of data and transaction) risk.

Tags: Database

Similar Questions

  • emails are sent to my contacts with my address email but iam not not sending them.

    emails are sent to my contacts with my address email but iam not not sending them.

    Hello

    If someone is Spoofing emails that appear to come from you then they probably never
    had access to your e-mail account. Instead, they have either a copy of your contacts
    list or just an email from you or one of you where you were one of the recipients. Those
    could be gleaned either your computer, the computer of a friend, or hacking
    any site or intercept an email on your behalf or to you (you may not be the main)
    (beneficiary).

    Once they have this information there is nothing you can do to avoid that they don't
    send usurped messages. Warn your friends that is happening and they
    can be entitled to install rules such as parodies are treated as SPAM or JUNK
    mail.

    I've even seen usurped by email that appears to be from a valid user name however
    This name doesn't have an e-mail account on the mail system used in parody.
    As SpiritX - AT - realmail.com may be a valid account, however, parody used
    SpiritX - AT - wrongmail.com. The latter could still be considered an email address valid
    SpiritX if it was allowed through JUNK and JUNK e-mail filtering. (The - AT - has been used
    instead of so that those addresses would not be filtered by auto responses.
    as if by magic.)

    ============================================================

    Proceed to a very thorough check for malware and then change your password by e-mail.

    The reason why you want to do this is to make sure no more hacking your computer is
    still in effect (if it has been hacked). You have changed the password once but I would
    Change it again after these checks.

    It is possible for a person to send the email that 'seems' to be of your
    account but that is not really - called "Spoofing." That means its 'Possible' emails
    were not really you, although they may have your contact list. Have someone
    who receives the e-mails to check the header to see where he is actually sent by and
    NOT only the answer to the address.

    How to read the message headers
    http://www.emailaddressmanager.com/tips/header.html

    What Email Headers can tell you about the origin of Spam
    http://email.about.com/cs/spamgeneral/a/spam_headers.htm

    E-mail spoofing
    http://en.Wikipedia.org/wiki/E-mail_spoofing

    E-mail spoofing and Phishing
    http://www.mailsbroadcast.com/email.broadcast.FAQ/46.email.spoofing.htm

    Understanding E-mail Spoofing
    http://www.windowsecurity.com/articles/email-spoofing.html

    Fraudulent emails (false)
    http://pages.eBay.com/education/spooftutorial/

    Google search - email Spoofing
    http://www.Google.com/search?hl=en&EI=FB1nS9DiNo7CsQPNhKGdAw&SA=X&Oi=spell&resnum=0&CT=result&CD=1&ved=0CAgQBSgA&q=email+spoofing&spell=1

    =============================================

    If you need search malware here's my recommendations - they will allow you to
    scrutiny and the withdrawal without ending up with a load of spyware programs running
    resident who can cause as many questions as the malware and may be more difficult to detect as the
    cause.

    No one program cannot be used to detect and remove any malware. Added that often easy
    to detect malicious software often comes with a much harder to detect and remove the payload. Then
    its best to be thorough than paying the high price later now too. Check with them to one
    extreme overkill point and then run the cleaning only when you are sure that the system is clean.

    It can be made repeatedly in Mode safe - F8 tap that you start, however, you must also run
    the regular windows when you can.

    Download malwarebytes and scan with it, run MRT and add Prevx to be sure that he is gone.
    (If Rootkits run UnHackMe)

    Download - SAVE - go to where you put it-right on - click RUN AS ADMIN

    Malwarebytes - free
    http://www.Malwarebytes.org/products/malwarebytes_free

    Run the malware removal tool from Microsoft

    Start - type in the search box-> find MRT top - right on - click RUN AS ADMIN.

    You should get this tool and its updates via Windows updates - if necessary, you can
    Download it here.

    Download - SAVE - go to where you put it-right on - click RUN AS ADMIN
    (Then run MRT as shown above.)

    Microsoft Malicious - 32-bit removal tool
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=AD724AE0-E72D-4F54-9AB3-75B8EB148356&displaylang=en

    Microsoft Malicious removal tool - 64 bit
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=585D2BDE-367F-495e-94E7-6349F4EFFC74&displaylang=en

    also install Prevx to be sure that it is all gone.

    Download - SAVE - go to where you put it-right on - click RUN AS ADMIN

    Prevx - Home - free - small, fast, exceptional CLOUD protection, working with others
    security programs. It is a single scanner, VERY EFFICIENT, if it finds something to come back
    here or use Google to see how to remove.
    http://www.prevx.com/   <-->
    http://info.prevx.com/downloadcsi.asp?prevx=Y  <-->

    Choice of PCmag editor - Prevx-
    http://www.PCMag.com/Article2/0, 2817,2346862,00.asp

    Try the demo version of Hitman Pro:

    Hitman Pro is a second scanner reviews, designed to save your computer from malicious software
    (viruses, Trojans, rootkits, etc.). who infected your computer despite safe
    what you have done (such as antivirus, firewall, etc.).
    http://www.SurfRight.nl/en/hitmanpro

    --------------------------------------------------------

    If necessary here are some free online scanners to help the

    http://www.eset.com/onlinescan/

    -----------------------------------

    Original version is now replaced by the Microsoft Safety Scanner
    http://OneCare.live.com/site/en-us/default.htm

    Microsoft safety scanner
    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    ----------------------------------

    http://www.Kaspersky.com/virusscanner

    Other tests free online
    http://www.Google.com/search?hl=en&source=HP&q=antivirus+free+online+scan&AQ=f&OQ=&AQI=G1

    --------------------------------------------------------

    After the removal of malicious programs:

    Also follow these steps for the General corruption of cleaning and repair/replace damaged/missing
    system files.

    Run DiskCleanup - start - all programs - Accessories - System Tools - Disk Cleanup

    RUN - type in the box-

    sfc/scannow

    Then run checkdisk (chkdsk).

    RUN - type in the box-

    Chkdsk /f /r

    -----------------------------------------------------------------------

    If we find Rootkits use this thread and other suggestions. (Run UnHackMe)

    http://social.answers.Microsoft.com/forums/en-us/InternetExplorer/thread/a8f665f0-C793-441A-a5b9-54b7e1e7a5a4/

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • "Shipped" Email not sent (issue of integration)

    Hi all

    We integrate our BC site with accounting/inventory Unleashed using OneSaaspackage.

    At the moment when an order is placed on our site of BC, he went to Unleashed, which is controlled by our shipping team. It is then marked as 'Dispatched' in Unleashed, and the next synchronization, the status of the order in British Colombia is updated to "Shipped". So far so good

    But we found that when you use this method, the customer shipping notice is not sent. Yes, we turned on "Informing the client" on goods shipped in the type Manager. And notification of dispatch work if I change the status of the order of British Colombia. It works just not when the order status is changed to sync with the integration of Unleashed/OneSaas.


    It is perhaps a better question for OneSaas (and I'll be in touch with them as well!) but I was wondering if anyone has any bright ideas for a workaround


    Thanks in advance for your help

    You need a support ticket, asking him to go to the engineering team.

    I think it fires in the admin because I think that the request in this sense is a trigger of javascript in the admin on record the order and not something that is just in the system which also runs when it changes through the API.

  • Record the new laptop, no Confirmation email not sent? Help please!

    Hey all,.

    So, I got my new laptop computer and finally registered online to benefit from the guarantee. Everything went well and my account is performed and recorded.

    However, I've been waiting for about 2 hours now for an email confirmation just to keep in my files that all went well, (need the copy just in case for warranty purposes) but nothing has been sent!

    My Email is Correct, I checked the spam and trash folder and any confirmation e-mail from HP again!

    I really need this email to keep in my books, and I'm confused why it has not yet been sent. There may be a day or two?

    I do not know. Can someone enlighten me on this?

    Thank you

    Hi @megamega100,

    Welcome to the HP Forum!

    It's a great place to find answers and advice! You have the best experience in the HP forum, I would like to draw your attention to the HP Guide's Forums:

    First time here? Learn how to post and more

    Yes, this can take a few days of notification of update of guarantee.  As you can image you are not alone and they must update the system with the information and it could take a few days.  In the meantime, you can check to see if it has been updated on the HP Web site:

    Check the status of your warranty

    If the guarantee is not yet updated, give it a few days and check again.  Should it still not be updated, please contact HP support and that your warranty information available for them.

    Please contact HP to Contact HP Supportassistance.

    Please keep me updated on the progress.

    Please let me know if that solves the problem by marking this post as 'Accept as Solution'. "To simply say thank you, click on the" ","inch Up ' below!   If you need more assistance let me know and I will gladly do everything I can to help.

  • emails not sent to microsoft outlook

    I have not received emails on outlook since July, it's extremely frustrating. I can access my hotmail via the internet, however, prefer to use microsoft outlook. I also began to receive a box requires me to enter my network password.  I walked several times, but the box keeps reappearing every minute.  I have reset my hotmail password and entered it in the box pop up, but it still seems.  I don't have this problem when the mail is delivered for iphone.  The mail has been delivered to my phone, I have not opened, but checked to see if it appears in outlook on my computer, but apparently not. It is strange that it worked perfectly until the beginning of July and all of a sudden nothing.  I've had my iphone for 2 years so don't think what could be the problem.  How can I get my emails sent to outlook and how can I get the annoying pop up box to stop appearing?  If I have to re - setup my e-mail in outlook, I have lost all my emails stored in folders under my Inbox?  Can you confirm the settings, I need a hotmail address to receive/send emails.

    It would be a good question for the experts in a forum of Outlook.

    http://answers.Microsoft.com/en-us/Office/forum/office_2010-outlook

  • Email not sent

    Hello, I tried to send an email and the code compiles and when I walk through the debugger that throws any errors that I can see, however, the message does not seem to be sent.  I can send the PIN in the same way and it works but when I change it to sms - mms it just doesn't work.

    I visited this site (http://mccondach.com/blog/blackberry-10-list-of-accountservice-providers/) and tried different vendor IDs, but none does.

    Here is the code I use.

    Sub ApplicationUI:{endAnEmail()}
    AccountService accountService;
    MessageService service;

    QList accounts = accountService.accounts (Service::Messages, "sms - mms");

    If (Accounts.Size () > 0) {}
    Account = accounts.first ();
    MessageBuilder * generator = MessageBuilder::create(account.id());
    bool added;
    MessageBuilder * generator = MessageBuilder::create (1);
    MessageContact firstRecipient = MessageContact (1, MessageContact::To, "Stan", "[email protected]");
    generator-> topic ("write me");
    generator-> body (MessageBody:lainText, QString ("this is a test") .toUtf8 ());
    generator of-> addRecipient(firstRecipient, &added);)
    Message message = * manufacturer;
    service. Save (Account.ID (), message);
    service. Send (Account.ID (), message);
    Delete the constructor;
    }

    }

    Thanks in advance for your help,

    Stan

    You try to send a SMS message to an email.

    SMS first use conversation, no message. Use of e-mail.
    And second, you must use an e-mail account and send the message as it is right now on the email account. Use "imapemail" or "popemail" (or both) to get a list of accounts, instead of "sms - mms.

  • Mail continues to blink the same email not sent to me and will let me not spending at all. Any ideas?

    My newly purchased and generally fabulous MB Pro has a malfunction in the mail. A partly addressed msg keeps flashing on the screen and I can't remove it. Can I delete the mail and start over?

    Yes.

    Note:

    A new Mac comes with 90 days of free technical support, AppleCare.

    AppleCare: 1-800-275-2273

  • retrieve an incomplete, unfinished email not sent

    I asked a? on a draft law of mine. typed a "contact support" and he accidentally closed before sending. Anyway, or anywhere I can find it again? I tried history but my letter had gone on this support page. I've done this before and I take a lot of time to write the cause I can't type.

    Hi Anniebnutz,

    You can check in the drafts in your email/support page for the e-mail.

    If it is not there in the projects, it would have been lost in the system.

  • Annoying pop up about email not sent

    email seems to be "stuck" in the sent box - e-mail wasn't wanted person - pop - up continues to come and ask if you want to send by email - answer is no - I just want to get rid of annoying pop-up and remove email - thank you

    PAM Smith

    And your unknown e-mail program?

    In general terms; try to set your e-mail offline application, and then deleting the mail in your 'send file '.

  • Emails not sent immediately!

    When I try to send emails in Hotmail, they just sit in the box shipping for hours and sometimes days. Can someone explain what is happening here and how to put it right. Chris.

    Windows Live Hotmail is supported in this forum
    http://answers.Microsoft.com/en-us/windowslive/Forum/Hotmail?tab=all

  • Email with a large attachment are not sent.  How to cancel it?

    I sent an email (via my yahoo account but using my mail app on my iMac) with an attached video.  Well, the video was apparently too big and is not stuck and are not sent.  It drives me crazy because I can't access my e-mail and it slows everything down while the circle of Rainbow rotation will not stop!  How can I stop it?  I tried the reboot, restart, force, abandonment of post.  I'm afraid to open mail application more because every time I do, the spinner starts and I am doomed!  Help!

    Menu messaging-> window-> activity there, you can stop sending the mail.

  • I was tring hard to recover my other hotmail accounts with no luck, because I have not any reccolection what was the last email I sent.

    too many trys

    I was tring hard to recover my other hotmail accounts with no luck, because I have not any reccolection what was the last email I sent.  I have all my friends address because they have been whipped out of my Inbox.  I usued a site that keep all passwords and address in a single area and it has been deleted. Can I get some kind of help for this if possible wha is the solution?

    Questions of Hotmail post in the appropriate forum found here:
    http://windowslivehelp.com/

  • I use different e-mail accounts: I send an email with the sender A (standard!), email is archived to the sender sent archive and the email is sent to the sender, B

    A really strange problem!

    I use different e-mail accounts. I send an email with a sender (defined as standard!), email is archived in archive A sent from the sender, the sender is wrote in the header of the email as the sender, but the email is sent with the sender B written as the sender in the email received.

    Best regards, Michael

    It sounds like you do not use the right smtp server to send the e-mail.

    Please check what 'Sender A' smtp server account uses.
    'Tools' > 'Account settings' for the e-mail account
    or
    Right click on the email account in the folders pane, and then select "settings".
    Lower-right - outgoing (SMTP) server - select the correct SMTP server for that e-mail account.
    See the image below as an aid.
    Click OK

    If you are unsure about what to do please post the following information:

    In Thunderbird

    • Help > troubleshooting information
    • Click on 'copy text to the Clipboard.
    • In the forum, in this issue, right-click in a text box ' Post a reply ' and choose 'paste '.

    Tell me the number of the account which is "sender."
    Tell me the number of the account how recipient sees as venues.

  • same email is sent continuously all by appearing not not in the sent box

    using my iPhone 6, same email is sent continuously all by appearing not not in the sent box. for two days

    Hi FKDK,

    Thank you for reaching out to the communities of Apple Support.

    I know it's important to keep you email works as expected. If you have not already the case, try to restart your device by pressing and holding down the button on/standby and then dragging down to the power.

    Restart your iPhone, iPad or iPod touch

    Once your phone restarts try to return or to re - write the e-mail and send again. If the problem persists after that, let us know if the e-mail has all attachments, or if the problem occurs with all of your emails.

    Once again thanks for joining the best wishes.

  • My office print 8600 ProPlus will not print pdf files sent from an iPad with ePrint.

    My office print 8600 ProPlus will not print pdf files sent from an iPad with ePrint.  I just get an error message when I go to the HP Eprint centre.  It prints the address email of the coverage, but nothing else.  The attachment is not sure that I can see.  I tried to send an attachment from my Mac and worked well.

    Thank you for your response and I am sorry for the delay to return to you.  I tried save the Pages document in a Word document and send it to the printer using ePrint but it is even.  That is to say the handout printed but not the attachment.  However, when we removed the accompanying document and sent the attachment in its own it has worked well for we have managed to solve the problem. Thank you very much.

Maybe you are looking for