Sending email from within a stored procedure

Is it possible to send and email within a stored procedure written in PL/SQL. I have searched this site and the web for an Oracle package which simulates a mail agent written in PL/SQL, but I have not had any success.
null

Well, on NT one way we did it was to link to kernel32.dll so we could execute OS commands (WinExec), and did the email that way.
Here's a bit of script to try:
connect sys/@db;
drop library kernellib;
CREATE LIBRARY kernellib as 'c:\winnt\system32\kernel32.dll';
show errors
CREATE OR REPLACE PACKAGE UTIL IS
function run(lpCmdLine IN varchar2, nCmdShow IN binary_integer) return binary_integer;
end;
show errors
CREATE OR REPLACE PACKAGE BODY UTIL IS
function run(lpCmdLine IN varchar2, nCmdShow IN binary_integer) return binary_integer
AS EXTERNAL
NAME "WinExec"
LIBRARY kernellib
parameters (lpCmdLine STRING, nCmdShow long);
end;
show errors
Then you just call util.run() with an appropriate command line to send email. Bit of a hack, but it depends on what you want to do with it. Another hack would be to use the UTL_HTTP package to submit a form to your web server and use a CGI program to send the email.

Similar Messages

  • Cannot send email from within iPhoto

    Using OX X 10.7.5 cannot send email from within iPhoto.  I get this error message: "Your email did not go through because the server did not reply."
    If I change the preference to use email, everything goes fine but I lose the formatting feature.

    iPhoto Menu ->
    Preferences ->
    Accounts ->
    Delete and recreate your email settings.
    Alternatively, use Apple's Mail for the job. It has Templates too - and more of them. Check out the Stationery...

  • Send email from within apex 2.1 application

    Hello,
    I like to send email from within apex application. I use oracle 10g xe with apex 2.1
    thx for advice
    Edited by: wucis on Feb 27, 2012 11:49 AM

    That is a very old version indeed. The documentation for sending emails from Apex 2.2 is here:
    http://docs.oracle.com/cd/B31036_01/doc/appdev.22/b28550/advnc.htm#BABJHJJF

  • Creating a table/view or temporary table from within a stored procedure

    Hi Gurus,
    Can someone tell me if it is possible to create a table (or view) from within a stored procedure.
    PROBLEM:
    In fact I need to create a report at back end (without using oracle developer forms or reports). This report requires creating several tables to hold temporary report data. If I create a sql*plus script for this, i works fine, because it can run DDL and other sql or pl/sql statements sequencialy. But this sql*plus script cannot be called from application. So, application needs an stored procedure to do this task and then application call that procedure. But within stored procedure, i am unable to create table (or run any ddl statement). Can somebody help me in this?
    Thanks in Advance.

    Denis,
    The problem with Nicholas' suggestion isrelated to the fact that now you have two components
    (a table and a stored procedure)
    I don't see any problem to have "two
    components" here. After all, what about all others
    tabes ? This is only one more, but I don't understand
    why want manage less objects, that implies more code,
    more maintenance, and more difficulties to debug.
    Needless to say about performance...
    Nicolas.The same reasons apply if you were forced to declare all PL/SQL variables publicly (outside the stored proc.) rather than privately (from inside the stored proc). Naming conflicts for one. If the name that you want to use for the GTT already exists, you need to find a new name. With the SQL Server type local/private declarations, you wouldn't have that problem.
    I can see how performance would be the same or better using GTTs. If the number of records involved is low, this is likely negligable.

  • When try send email from within iPhoto says password not recognised

    Hi,
    Trying to send email from withinn iPhoto always get message saying password not recognised even though set correct password email address within preferences in iPhoto. Believe this started when I upgraded to Lion.
    Lates Lion and iphoto updates downloaded
    Thanks
    Rick

    LarryHN I not understand your advice
    iPhoto preferences>
    Accounts>
    there I have Facebook and MobileMe as Accounts
    I tried adding new account and the only options (Apple related) offered are MobileMe and Email going
    EMail>
    again offers iCloud and mobileme
    using iCloud doesn't work i.e. the account sets up but still cannot send email through iPhoto
    I am registered with iCloud and it works fine in other applications
    I am reluctant to delete MobileMe from iPhoto since if I do so I will not be able to add it again I still have photos etc in my MobileMe iDisk which I will need to move somewhere else soon with demise of MobileMe
    Thakns for your advice

  • I am no longer able to send emails from within iPad apps.

    I always used to be able to send files with attachments by email from within iPad apps like Adobe Reader or Pages. Used to work but now it doesn't - and this for all apps all at once. It gets to the point where it has prepared the email, but if you press send, it says "Could not save or send message". It also doesn't matter which email account I use - result always the same. It's a real pain as this was a good way of editing a word file and then emailing it to myself.

    Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps from the tray BEFORE doing the reset.

  • Running "Host" From Within a Stored Procedure

    Hellow
    Wanna Run a "Host" Command from Within A SP
    or DB Trigger
    Any Help is Appreciated !!
    Regards
    Tariq

    the only way to run an OS command from within the database is through extproc
    (works from 8.x onwards).
    Essentially, you have to:
    - modify the database listener to support external procedure calls
    - create a library object
    - create a C - program and compile it as a shared library
    - write a wrapper function in PL/SQL that calls the shared library
    I can send you an example, if you want.
    Regards
    Anton Weindl

  • Sending Emails from Within On Demand

    Is it possible to send an email directly from within CRM On Demand when viewing an account or contact ? Similar to the way in Siebel OnPremise you can click a button to send an email and even select a pre-defined email template ?

    Have you tried using a mailto link on the form. We have found that this is accomplishes a lot of what F9 did in SOP. What you don't get is multiple templates, as the template is defined when you create the web link.
    Greg.

  • SELECT query from within a stored procedure

    DB Version:10gR2
    For auditing purpose, i just want to execute the query within the IF condition, and get the results for spooling. But i am getting PLS-00428 error. Can't i just execute a SELECT query and get its results displayed in SQLPLUS so that i can spool them?
    SQL> create or replace procedure ship_dtl_aud
      2  is
      3  v_exists number;
      4 
      5  begin
      6  
      7  Select count(1) into v_exists
      8  From ship_dtl
      9  WHERE track_code = 10
    10  AND mod_date_time < SYSDATE - 1/(24*60);
    11 
    12   if v_exists>0
    13   then
    14            select s.username,s.sid, s.serial#, s.terminal,p.spid
    15   from v$session s, v$process p
    16   where s.paddr = p.addr and s.sid in (select SESSION_ID from V$LOCKED_OBJECT);
    17 
    18          end if; 
    19  end;
    20  /
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE ship_dtl_aud:
    LINE/COL ERROR
    14/11    PLS-00428: an INTO clause is expected in this SELECT statement

    Within PL/SQL code, the results of a query have to be returned from the SQL engine to the PL/SQL engine, hence why it is asking you to include an INTO within your query. Note that the PL/SQL engine is running on the database server so it has no interface to display output to. To output from within PL/SQL you would have to write the data out yourself to whatever output you want e.g. use DBMS_OUTPUT to put the data to the standard output buffer (which can then be read by SQL*Plus if serveroutput is set to "on") or written out to a file on the server, or written out to a table.
    You are assuming that because you can execute SQL from SQL*Plus and spool the output, you can do the same within PL/SQL. This is not the case. When SQL*Plus issues a SQL statement, it goes to the SQL engine and the results of that cursor (as an SQL query is a cursor) are collected by SQL*Plus and it displays them itself. When PL/SQL issues a SQL statement, it goes to the SQL engine and the results of that cursor come back to PL/SQL. PL/SQL doesn't have a display mechanism, so the results have to be collected INTO something.
    Hope that's clear.

  • Cannot send an email from within contacts on iPhone

    I’m trying to send email from within my contacts list app on my iPhone but the send button will not highlight and therefore cannot be pressed to send the email.   Sending email from the mall app works fine. Anyone know why this is happening?

    That also occurs for me and looks like a bug. The problem seems to be that, although the "To" address appears in the draft email, the iPhone does not think that it is there and won't activate the Send button. If one simply touches the "To" field the address disappears.
    Submit this as a bug at http://www.apple.com/feedback/iphone.html

  • Send email from PL/SQL trigger on Solaris

    I searched all of the Oracle site looking for this capability, and found many messages several months old essentially saying there is no easy way to do this. I thought I remembered seeing an example of this in the online documentation, but of course I can't find that now. Is there any simple way of sending email from within an insert trigger written with PL/SQL?

    Try the pl/sql code below.
    create or replace PROCEDURE send_test_message
    IS
    mailhost VARCHAR2(64) := '191.168.251.207'; -- ip address of the mail server.
    sender VARCHAR2(64) := '[email protected]';
    recipient VARCHAR2(64) := '[email protected]';
    mail_conn utl_smtp.connection;
    BEGIN
    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.open_data(mail_conn);
    utl_smtp.write_data(mail_conn, 'Your leave is Cancelled due to xyz...reason ' || chr(13));
    utl_smtp.write_data(mail_conn, 'This is line 2.' || chr(13));
    utl_smtp.close_data(mail_conn);
    utl_smtp.quit(mail_conn);
    EXCEPTION
    WHEN OTHERS THEN
    -- Insert error-handling code here
    NULL;
    END;

  • Why can't I send Emails from iPad apps?

    When I am using iBooks, or Evernote, or Hootsuite, or just about any application on my iPad that allows me to Email items from within the application, the following happens when I try to send an Email:
    1) I click the share button.
    2) Choose Emaill
    3) Write the Email.
    4) Click Send
    5) Hear swoosh sound and it appears the Email is sent.
    However, the Email is never actually sent.  I've tested this mutiple times to various Email addresses and it just isn't sending the Email.  The only exception is when I send Emails from within the Gmail app, in which case they send fine.
    After discovering this I took our my iPhone 5 and tried to do the same from there with the same applications.  I was able to send Emails from within the iPhone applications just fine so this problem is specific to my iPad.
    I checked my mail settings and didn't see anything out of order.  As I said, I can successfully send Email from the iPad using the Gmail app or just sending it from within a Chrome window.
    Thoughts?

    I used to be able to send e-mail from within apps on my iPad. Then all of a sudden, I was unable to do it. I changed none of my settings, and my regular e-mail works just fine.  One day I could e-mail from within apps, and then next I could not.
    When I hit the share button within an app, I then select the e-mail button. An e-mail message opens for composition. It has the subject line filled in, but that's all. It will not allow me to enter the address and it contains no message or link. It's just dead. Sometimes I wait for a while to see if anything changes, but it doesn't.
    Did apple change something without telling us?

  • Is it possible to read , send emails from the database in oracle8.

    Hi,
    My present project needs me to send emails from the database through procedures. There is an oracle package UTL_HTTP in oracle8 which could be used to read emails from database. So kindly tell how to go about sending an email from the database. Is this feature available in Oracle8i.
    Thank you.

    Okay , Here's my Javascript wgich is in an onload process.
    Javascript variable addr_str displays the correct result.
    My hidden field is called P101_CHECKVAL.
    <html>
    <title>CodeAve.com(JavaScript: Display All URL Variables)</title>
    <body bgcolor="#FFFFFF">
    <script language="JavaScript">
    <!--
    // Create variable is_input to see if there is a ? in the url
    var is_input = document.URL.indexOf('P101_CHECKVAL:');
    // Check the position of the ? in the url
    if (is_input != -1)
    // Create variable from ? in the url to the end of the string
    addr_str = document.URL.substring(is_input+1, document.URL.length);
    // Loop through the url and write out values found
    // or a line break to seperate values by the &
    for (count = 0; count < addr_str.length; count++)
    if (addr_str.charAt(count) == "&")
    // Write a line break for each & found
    {document.write ("<br>");}
    else
    // Write the part of the url
    {document.write (addr_str.charAt(count));}
    // If there is no ? in the url state no values found
    else
    {document.write("No values detected");}
    -->
    </script>
    </body>
    </html>
    Everytime I put the HTML_get code into the javascript, it basically tells me I have an error on the page. So what exactly do I put that sets P101_CHECKVAL equal to the value of addr_str?

  • Problem sending email from Acrobat

    I cannot send email from within Adobe Acrobat Pro 9. I was told it was because I use Outlook 2011 as my default mail program. I was also told that I could send the email from Acrobat through the MAC OS. Do I have to go back to using the mail.app as my default mail application to do this, or is there a way to continue using Outlook as my default mail app, and use the MAC OS for sending mail from within other applications?

    I don't think that you can, I switched from Entourage to Outlook and neither of them would so now I use Mac Mail.

  • Can't email from within iPad apps

    On my iPad w/Retina, I am unable to send email from within an application. Within Pages, for example, trying to email a document produced a "Couldn't send or save message" dialog. From within my NYT app, trying to email an article link produces "The operation could not be completed. (MFMailComposeErrorDomainError1.)" IPad's native mail app works fine.
    Any thoughts?

    Just got a reply to the same question in a different post, but it still doesn't tell me how to actually solve the problem, somstill waiting. See if this helps you:
    Douglas Johnson1
    Re: Why can't I send Emails from iPad apps?
    09-Jul-2013 15:29 (in response to Louises)
    I fixed this problem.  In my case I was using the GMail app and I NEVER used Apple's Mail app that came with my iPad.  So I had been checking all my settings for the Gmail app and I was ignoring the settings on Apple's Mail app.  It turns out that even if you never use Apple's Mail app, other apps DO use Apple's Mail app when they send Email from within their repsective applications. 
    So I'm guessing you aren't using Apple's Mail app and you've therefore ignored the settings on that app.  Fix all those settings and you should be fine.

Maybe you are looking for

  • Delivery date calculation in auto scheduling

    Dear All, We have maintained planned delivery time , gr processing time in mm master as well infor records. We are running MRP and auto scheduling and updating schedule lines through MRP. System updating schedule lines and the delivery date also. wha

  • Serious Battery Problem: Lack of Charge and Quick Drain

    I have a 15" Macbook Pro purchased late July/early August 2008, model number A1260 and has its software completely updated. I use the computer every day and, aside from the occasional cycling after getting the battery charge down to 0%, charge the co

  • Disk Full Message with External Drive?

    I have a IMac, G5 and a Maxtor external 300 gig firewire hd that I've used for some time. Recently, while copying files, movie files that are 3 gigs I get a prompt that the Maxtor disk is full. I still have 189 gigs available on this drive and I'm on

  • My macbook pro i7, so new is too slow. bad. bad one.

    I do not understand how can it be so slow, and block all the time. it seems worse than my firs i book.

  • My line in does not work with output from my ipod

    I hooked my ipod up to the line in and changed the sound pref's to line in.   No sound comes from the speakers, YET, I see the volume graph on the sound prefs at high levels.   I then checked garage band.  even though I can record the sound from my i