Csnnot send email thru UTL_SMTP (PL-SQL)

If I try to send an email thru SQL it will work, but If i convert it to a PROCEDURE and then execute it with "EXECUTE PD_EMAIL('TEST','TEST'); It will give me the same error:
ORA-24247: network access denied by access control list (ACL)
Please help, this is ORACLE STANDARD EDITION 11G R2
The store procedure is as follows:
Create or Replace Procedure Pd_Email (Gv_Subject VARCHAR2, Gv_Body VARCHAR2) Is
Lv_From VARCHAR2(80) := '[email protected]';
Lv_To VARCHAR2(500) := '[email protected]';
Lv_Host VARCHAR2(30) := 'mail.myhost.com';
Lv_Conn Utl_smtp.Connection;
BEGIN
Lv_Conn := utl_smtp.Open_Connection(Lv_Host, 25);
utl_smtp.Helo(Lv_Conn, Lv_Host);
utl_smtp.Mail(Lv_Conn, Lv_From);
utl_smtp.Rcpt(Lv_Conn, Lv_To);
utl_smtp.Data(Lv_Conn,
'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') ||chr(13)||chr(10)||
'From: ' ||Lv_From ||chr(13)||chr(10)||
'Subject: '||Gv_Subject||chr(13)||chr(10)||
'To: ' || Lv_To||chr(13)||chr(10));
utl_smtp.Quit(Lv_Conn);
EXCEPTION
WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
raise_application_error(-20000, 'Email Error: '||sqlerrm);
END
Your help with me be greatly appreciated it.

Panamanian wrote:
Ok, since it does work in SQL, but not in a table trigger (if inserting). What should I check? or what sql statement should I run? for testing purposes?It cannot work in SQL as the SQL language does not support defining and using tcp sockets. PL/SQL is needed for that.
PL/SQL code is also what is used to define a trigger. So assuming the same schema is used, that PL/SQL code will be executed in the same environment irrespective of the call being via a trigger or via a normal database call.
That aside - sending e-mails from triggers is a terrible idea. A trigger is NOT intended to be used for something like that.
The transaction can be rolled back. The e-mail send cannot be undone - and en e-mail would have been send reporting on changes that never happened in the database.
The same trigger can fire twice for the very same row and transaction under special circumstances in Oracle. Thus 2 e-mails reporting the very same change... a change that can still be rolled back. How does that make sense?
The trigger can choke on mail errors. What then? Fail a perfectly valid business transaction that meets all consistency and validation rules, because the mail server is down, or there is a network problem or something?
That is not how robust applications are designed and written.

Similar Messages

  • Why am I getting syntax error messages when sending emails thru MS Office:MAC 2011?

    Why am I getting suntax error messages when sending emails thru my outlook on my MacPro?

    What are the exact and complete error messages?

  • How to send email thru generic email ID?

    I am sending payment advice as PDF email attachment. But it is going from the person's personal email ID who runs the remittance procedure but we don't want his email ID to come into picture. Is there any way we can send email thru a generic email address?

    Hi sheel,
    or consider the modern way, use cl_sapuser_bcs=>create for the sender you want, check my favorite
    [Unknown thus unloved?|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417600%29ID0244690950DB11730526581933624871End?blog=/pub/wlg/3443]
    Regards,
    Clemens

  • I'm having problems receiving/sending emails thru Outlook.

    I switched internet connection from AT&T to Comcast and I'm still utilized several AT&T email address's for free. I'm having problems receiving/sending emails thru Outlook.  Could the problem be due to using their free emails with no support.
    Do I have to go thru yahoo to read/send emails?

    Change the ISP would not effect the email connection generally. (Only when ISP disable your mailbox which they could control directly.)
    I suppose that your Outlook still store/cache the AT&T messages, try to export them as PST data file for backup.
    Setup the new Yahoo in your current Outlook first and then import that backup.pst to continue to use.
    http://support.microsoft.com/kb/287070/en-us
    Thanks
    Tony Chen
    TechNet Community Support

  • Sending email using UTL_SMTP

    Dear experts,
    I am trying to send an email using UTL_SMTP (i switched from UTL_MAIL to UTL_SMTP since i need to send mails with large attachments - BLOB). I am using the demo_mail package given here:
    http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
    While running the program I am getting an error message (from the error.log) saying:
    [Mon Aug 04 14:00:21 2008] [error] [client 192.168.0.7] mod_plsql: /ns/email_p.send HTTP-404 ORA-29279: SMTP permanent error: 530 5.7.0 Must issue a STARTTLS command first. 9sm12723808qbw.6\nORA-06512: at "SYS.UTL_SMTP", line 20\nORA-06512: at "SYS.UTL_SMTP", line 98\nORA-06512: at "SYS.UTL_SMTP", line 221\nORA-06512: at "NEXTSTEP.SEND_EMAIL_HELPER", line 258\nORA-06512: at "NEXTSTEP.SEND_EMAIL_HELPER", line 119\nORA-06512: at "NEXTSTEP.EMAIL_P", line 33\nORA-06512: at line 31\n, referer: file:///C:/Documents and Settings/Mayank/My Documents/Flex Builder 3/ns5/bin-debug/main.swf
    My code is as follows:
    PACKAGE DECLARATION. This is the DEMO_MAIL package posted under above link (I have renamed it).
    CREATE OR REPLACE PACKAGE NEXTSTEP.send_email_helper IS
      ----------------------- Customizable Section -----------------------
      -- Customize the SMTP host, port and your domain name below.
        smtp_host   VARCHAR2(256) := 'smtp.gmail.com';
        smtp_port   PLS_INTEGER   := 587;
        smtp_domain VARCHAR2(256) := null;
      -- Customize the signature that will appear in the email's MIME header.
      -- Useful for versioning.
      MAILER_ID   CONSTANT VARCHAR2(256) := 'Mailer by Oracle UTL_SMTP';
      --------------------- End Customizable Section ---------------------
      -- A unique string that demarcates boundaries of parts in a multi-part email
      -- The string should not appear inside the body of any part of the email.
      -- Customize this if needed or generate this randomly dynamically.
      BOUNDARY        CONSTANT VARCHAR2(256) := '-----7D81B75CCC90D2974F7A1CBD';
      FIRST_BOUNDARY  CONSTANT VARCHAR2(256) := '--' || BOUNDARY || utl_tcp.CRLF;
      LAST_BOUNDARY   CONSTANT VARCHAR2(256) := '--' || BOUNDARY || '--' ||
                                                  utl_tcp.CRLF;
      -- A MIME type that denotes multi-part email (MIME) messages.
      MULTIPART_MIME_TYPE CONSTANT VARCHAR2(256) := 'multipart/mixed; boundary="'||
                                                      BOUNDARY || '"';
      MAX_BASE64_LINE_WIDTH CONSTANT PLS_INTEGER   := 76 / 4 * 3;
      -- A simple email API for sending email in plain text in a single call.
      -- The format of an email address is one of these:
      --   someone@some-domain
      --   "Someone at some domain" <someone@some-domain>
      --   Someone at some domain <someone@some-domain>
      -- The recipients is a list of email addresses  separated by
      -- either a "," or a ";"
      PROCEDURE mail(sender     IN VARCHAR2,
             recipients IN VARCHAR2,
             subject    IN VARCHAR2,
             message    IN VARCHAR2);
      -- Extended email API to send email in HTML or plain text with no size limit.
      -- First, begin the email by begin_mail(). Then, call write_text() repeatedly
      -- to send email in ASCII piece-by-piece. Or, call write_mb_text() to send
      -- email in non-ASCII or multi-byte character set. End the email with
      -- end_mail().
      FUNCTION begin_mail(sender     IN VARCHAR2,
                  recipients IN VARCHAR2,
                  subject    IN VARCHAR2,
                  mime_type  IN VARCHAR2    DEFAULT 'text/plain',
                  priority   IN PLS_INTEGER DEFAULT NULL)
                  RETURN utl_smtp.connection;
      -- Write email body in ASCII
      PROCEDURE write_text(conn    IN OUT NOCOPY utl_smtp.connection,
                   message IN VARCHAR2);
      -- Write email body in non-ASCII (including multi-byte). The email body
      -- will be sent in the database character set.
      PROCEDURE write_mb_text(conn    IN OUT NOCOPY utl_smtp.connection,
                  message IN            VARCHAR2);
      -- Write email body in binary
      PROCEDURE write_raw(conn    IN OUT NOCOPY utl_smtp.connection,
                  message IN RAW);
      -- APIs to send email with attachments. Attachments are sent by sending
      -- emails in "multipart/mixed" MIME format. Specify that MIME format when
      -- beginning an email with begin_mail().
      -- Send a single text attachment.
      PROCEDURE attach_text(conn         IN OUT NOCOPY utl_smtp.connection,
                data         IN VARCHAR2,
                mime_type    IN VARCHAR2 DEFAULT 'text/plain',
                inline       IN BOOLEAN  DEFAULT TRUE,
                filename     IN VARCHAR2 DEFAULT NULL,
                    last         IN BOOLEAN  DEFAULT FALSE);
      -- Send a binary attachment. The attachment will be encoded in Base-64
      -- encoding format.
      PROCEDURE attach_base64(conn         IN OUT NOCOPY utl_smtp.connection,
                  data         IN RAW,
                  mime_type    IN VARCHAR2 DEFAULT 'application/octet',
                  inline       IN BOOLEAN  DEFAULT TRUE,
                  filename     IN VARCHAR2 DEFAULT NULL,
                  last         IN BOOLEAN  DEFAULT FALSE);
      -- Send an attachment with no size limit. First, begin the attachment
      -- with begin_attachment(). Then, call write_text repeatedly to send
      -- the attachment piece-by-piece. If the attachment is text-based but
      -- in non-ASCII or multi-byte character set, use write_mb_text() instead.
      -- To send binary attachment, the binary content should first be
      -- encoded in Base-64 encoding format using the demo package for 8i,
      -- or the native one in 9i. End the attachment with end_attachment.
      PROCEDURE begin_attachment(conn         IN OUT NOCOPY utl_smtp.connection,
                     mime_type    IN VARCHAR2 DEFAULT 'text/plain',
                     inline       IN BOOLEAN  DEFAULT TRUE,
                     filename     IN VARCHAR2 DEFAULT NULL,
                     transfer_enc IN VARCHAR2 DEFAULT NULL);
      -- End the attachment.
      PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
                   last IN BOOLEAN DEFAULT FALSE);
      -- End the email.
      PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection);
      -- Extended email API to send multiple emails in a session for better
      -- performance. First, begin an email session with begin_session.
      -- Then, begin each email with a session by calling begin_mail_in_session
      -- instead of begin_mail. End the email with end_mail_in_session instead
      -- of end_mail. End the email session by end_session.
      FUNCTION begin_session RETURN utl_smtp.connection;
      -- Begin an email in a session.
      PROCEDURE begin_mail_in_session(conn       IN OUT NOCOPY utl_smtp.connection,
                      sender     IN VARCHAR2,
                      recipients IN VARCHAR2,
                      subject    IN VARCHAR2,
                      mime_type  IN VARCHAR2  DEFAULT 'text/plain',
                      priority   IN PLS_INTEGER DEFAULT NULL);
      -- End an email in a session.
      PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection);
      -- End an email session.
      PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection);
    END;How should I solve the above error? Can anyone help me with my query please?
    If I add the code to start TLS it still gives me an error. If I add the code
    utl_smtp.command(conn,'STARTTLS');
    utl_smtp.helo(conn, smtp_domain);
    under email_sender_help package just before under begin_session function, it gives me an error saying:
    ORA-29279: SMTP permanent error: 503 5.5.1 EHLO/HELO first. s27sm2097329qbs.12
    So then if i enter the same code after:
    utl_smtp.command(conn,'STARTTLS');
    utl_smtp.helo(conn, smtp_domain);
    It gives me an error:
    ORA-29278: SMTP transient error: 421 Service not available
    Message was edited by:
    Monk
    Message was edited by:
    Monk

    look like rely turned off on the server..
    check this.. or ask your network guys..
    Go to Control Panel->Add or Remove Programs->Click on
    Add/Remove Wndows Components
    Check IIS check box.
    Select Internet Information Service (IIS) option and click on Details button
    Check whether SMTP Service is checked or not.
    If not selected then select SMTP check box.
    This process should be done on server.
    It will help out from ORA-29278: SMTP transient error: 421 Service not available problem.
    thanks

  • Send Email Hangs - UTL_SMTP

    Hi All,
    I am tryin to write a package to send email notifications, when i try to execute this package it just hangs and never sends any email. Any taughts why this is happening.
    create or replace package body
    pm.email_pkg
    is
    -- Email Package
    mv_r varchar2(2) := utl_tcp.crlf;
    procedure send_mail
    sender in varchar2,
    recipient in varchar2,
    subject in varchar2 default null,
    message in varchar2
    is
    mailhost varchar2(30) := util_pkg.f_sysinfo('SMTP');
    smtpport number := util_pkg.f_sysinfo('SMTP_PORT');
    mail_conn utl_smtp.connection;
    begin
    mail_conn := utl_smtp.open_connection(mailhost, smtpport);
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, sender);
    utl_smtp.rcpt(mail_conn, recipient);
    --utl_smtp.data ( mail_conn, 'Subject : '|| subject || mv_r || mv_r || message );
    utl_smtp.open_data(mail_conn) ;
    utl_smtp.write_data(mail_conn, 'Subject : '|| subject || mv_r || mv_r || message );
    utl_smtp.close_data(mail_conn);
    utl_smtp.quit(mail_conn);
    exception
    when others then
    -- handle the error
    null;
    end send_mail;
    procedure taskemail
    is
    cursor c_tasks is
    select t.name, t.techuser, t.projectid, p.name pname, t.assigndate, t.descr
    from tasks t, projects p
    where t.projectid = p.projectid
    and trunc(t.created) = trunc(sysdate);
    cursor c_notify (pv_user varchar2) is
    select id
    from notifications
    where owner = pv_user
    and notid = util_pkg.f_sysinfo('TASK_NOTIFY');
    mv_sender varchar2(64) := util_pkg.f_sysinfo('SENDER_EMAIL');
    mv_recipient varchar2(64);
    mv_subject varchar2(100) ;
    mv_message varchar2(4000);
    begin
    for i in c_tasks
    loop
    select email
    into mv_recipient
    from user_info
    where user_name = i.techuser;
    if mv_recipient is not null then
    mv_subject := 'Assigned to:' || i.name;
    mv_message := 'You have been Assign the following Task' || mv_r;
    mv_message := mv_message || mv_r;
    mv_message := mv_message || 'Task: ' || i.name || mv_r;
    mv_message := mv_message || 'Project ' || i.pname || mv_r;
    mv_message := mv_message || mv_r;
    mv_message := mv_message || 'Description:' || mv_r ;
    mv_message := mv_message || i.descr;
    for j in c_notify(i.techuser)
    loop
    email_pkg.send_mail(mv_sender, mv_recipient, mv_subject, mv_message);
    end loop;
    end if;
    end loop;
    end taskemail;
    procedure email_notifications
    is
    begin
    email_pkg.taskemail;
    end;
    end email_pkg;
    show errors

    SQL> begin
    2 email_pkg.email_notifications;
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-29531: no method get_crlf in class oracle/plsql/net/TCPConnection
    ORA-06512: at "SYS.UTL_TCP", line 559
    ORA-06512: at "SYS.UTL_TCP", line 552
    ORA-06512: at "PM.EMAIL_PKG", line 7
    ORA-06512: at line 2

  • Sending email thru owb

    I am writing a very basic process flow to test if I can send an email.
    I have a start, an email, and a stop.
    I have the smtp server identified but I am getting the following error.
    ORA-20000: Failed to send mail due to the following error: ORA-29279: SMTP permanent error: 501 5.0.0 HELO requires domain address
    ORA-06512: at line 30
    Any suggestions would be greatly appreciated.
    Dan

    Are you sure that the values that you have passed are correct, and no you done have to sue utl_mail , if the email operator doesnt work then probably you have to use utl_mail but then why do the work when there is a ready made option available which only needs to be configured.
    example
    You can instruct Warehouse Builder to send email notifications after the completion of an activity in a process flow. You may find this
    useful, for example, for notifying administrators when activities such as mappings end in error or warnings.
    Table 22-6 lists the parameters you set for the email activity.
    Table 22-6 Email Activity Parameters
    Parameter      Description
    SMTP Server
    The name of outgoing mail server. The default value is localhost.
    Port
    The port number for the outgoing mail server. The default value is 25.
    From_Address
    The email address from which process flow notifications are sent.
    Reply_To_Address
    The email address or mailing list to which recipients should respond.
    To_Address
    The email address(es) or mailing list(s) that receive the process flow notification. Use a comma or a semi-colon to separate multiple
    email addresses.
    CC_Address
    The email address(es) or mailing list(s) that receive a copy of the process flow notification. Use a comma or a semi-colon to separate
    multiple email addresses
    BCC_Address
    The email address(es) or mailing list(s) that receive a blind copy of the process flow notification. Use a comma or a semi-colon to
    separate multiple email addresses
    Importance
    The level of importance for the notification. You can type in any text such as, for example, High, Medium, or Low.
    Subject
    The text that appears in the email subject line.
    Message_Body
    The text that appears in the body of the email. To type in or paste text, select Value at the bottom of the Activity panel.
    The Process Flow Editor does not limit you on the amount of text you can enter.
    For email addresses, you can enter the email address with or without the display name. For example, the following entries are correct:
    [email protected]
    Jack Emp<[email protected]>
    Jack Emp[[email protected]]
    Jack Emp[[email protected]],Jill Emp[[email protected]]
    Jack Emp[[email protected]];Jill Emp[[email protected]]Edited by: Darthvader-647181 on Feb 24, 2009 1:27 AM

  • HT1430 I cannot send Emails thru Iphone tried what was recommended here but did not work

    cannot send Emails with AOL on this Iphone 5

    It started yesterday, before this I had no problems sending and receiving emails. I do not have a problem receiving only sending and my sender addres is correct and should not be rejected by the server which the error message says is happening?

  • Cannot send emails thru roadrunner

    i spoke to time warner and got their server names but still cannot send emails. no problem receiving them but if i am not on my roadrunner wifi i can't send emails on my iphone. could their be a second server i need to set if i am outside of their service? thanks

    Maybe this will help... http://discussions.apple.com/thread.jspa?messageID=13124872&#13124872

  • Wanna Send email thru Adobe form...using tcode VA41

    Hi Experts,
    My issue is
    I have created an Adobe form.
    Now I want to send this form thru email ...
    This adobe form has to be generated using tcode VA41 which is then attached and emailed to customer.
    How do i do that...
    Can anyone help in sorting out this issue....
    Regards,
    Vijaya
    Edited by: Vijaya B on Jul 16, 2009 3:57 PM

    Hi,
              Code a prog. to generate emails and find the user exit using tc : smod , cmod where the adobe form is been triggered in the Trasaction.
    Regards,
    kumar.

  • Can't send email thru VPN

    My wife works for a company that uses a VPN. She has it on almost all day. After 4 days of having my new OSX server up and running, I found out that she can't send thru her VPN. She can when she is off the VPN and used to be able to when I had my SuSE Linux server (which I replaced with OSX server). Here's the log for when she sends an email:
    Apr 16 19:49:21 server postfix/smtpd[10436]: 7E65241213: client=blah.time.com[64.0.0.243], sasl_method=CRAM-MD5, sasl_username=becki
    Apr 16 19:49:22 server postfix/cleanup[10439]: 7E65241213: message-id=<[email protected]>
    Apr 16 19:49:22 server postfix/qmgr[10422]: 7E65241213: from=<[email protected]>, size=6269, nrcpt=1 (queue active)
    Apr 16 19:49:22 server postfix/smtpd[10436]: disconnect from blah.time.com[64.0.0.243]
    Apr 16 19:49:41 server postfix/smtp[10440]: 7E65241213: to=<[email protected]>, relay=127.0.0.1[127.0.0.1], delay=20, status=sent (250 2.7.1 Ok, discarded, UBE, id=10303-02)
    The part that gets be is why the message is being discarded??
    When she uses squirrelmail, everything works fine. I can't find a setting to change the above.
    Any help??
    Thanks,
    Tom

    According to the logs, it is being discarded as Spam.
    Could be because of her IP or how the mail is formatted.
    Since she logs into your SMTP server to send mail, it would be best to set up a separate submission port and bypass the content filter for authenticated users.
    See here: http://mac007.com/?Tips:AlternateSMTPPorts

  • Setting "Follow Up" flag in email thru utl_smtp

    Hi,
    Can anybody tell me, how can I set up "Follow up" flag with date in mail using utl_smtp.
    Any help is greatly appreciated.

    Unless my recollection of RFC822, the "Follow Up" flag is not part of the SMTP protocol. So you'd have to ask the vendor of whatever front-end application your email recipients use how that particular application wants the follow up flag specified and whether the vendor extended the SMTP protocol to allow that.
    Justin

  • Get error message that server could not be found when sending email thru iPhoto

    I have established a icloud/mobile me account.  Trying to use iphoto to send photos with emails and always get error message that server coule not be found.

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    (2) Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Script to send email notification when sql server stops..

    Hi,
    I am looking for a script through which I can monitor sql server service status and if it down for any reason, I want to send email to Dba team.  How to achieve this? Did anyone has already done similar kind of monitoring?
    Again, I am not looking for any 3rd party monitoring system like SCOM etc.. I looking for a batch file or script outside sql which can solve this.
    Any help would be greatly appreciated.
    Thank you.

    There are two ways to do it:
    1). There is a job option wherein you can put the alert message and then in schedule option, select to alert you only when Sql Agent Services get restarted. So this way you will come to know when Sql Agent Services got restarted.
    2). From any centralize\third server apart from your database server\host, you can put a job to execute almost around every 5 minutes to check service status and then call a batch file which will call OSQL code to execute sql code for sending alert
    based on the message content you want to like below:
    Scripts below, even you can tweak more on this as per your environment requirement and even you can merge some scripts to make one out of two or similar, however keeping each separate one helps to track scripts.
    First Batch File with Name: ServiceStatusCheck.bat
    with below content
    Echo "Checking Service Status"
    :Query
    FOR /F "tokens=4 delims= " %%A IN ('SC QUERY "XXXXXXXXServiceNametobeCheckedPutHere" ^| FIND "STATE"') DO SET status=%%A
    IF "%status%"=="STOPPED" GOTO Shootout
    :Shootout
    'email for success in first attempt
    'Put path of batch file
    "D:\Script\Successemail.bat"
    Exit
    Second Batch file with below content which will call Sql file to send alert: File Name: Successemail.bat
    ECHO "Send Email Alert"
    OSQL -E -S XXXXXXXXX -i "D:\Script\Successemail.sql"
    ECHO "Done"
    Exit
    Third Sql File to send email: File Name: Successemail.sql
    Declare @bodyT varchar(200)
    Set @bodyT  =
    'Service was found in stopped status and Date & Time::'
     +replace(convert(varchar(20),GETDATE(), 102),'.','/')
     +'::'
     +convert(varchar(20),GETDATE(), 108)
    EXEC msdb.dbo.sp_send_dbmail
        @profile_name='Profilename',
        @recipients = '[email protected]',
        @body  = @bodyT,
        @subject = 'Service was found in stopped status, Check Details!!'
    GO
    Santosh Singh

  • Procedure for Sending Emails with Attachments

    Hi All,
    Q1. We wish to write a PROCEDURE that sends emails with attachments in SQL. Can someone please suggest the procedure code for the same?
    Q2. Apart from DBMS_JOB utlity can any other this procedure be scheduled to send automatic emails picking up files from a remote filer randomly.
    Regards,
    Chinmay

    http://www.lv2000.com/articles/utlsmtp.htm
    I do not understand what the article is trying to say when it says this:
    <quote>
    1. You cannot send a Subject line with your email.
    2. You cannot add attachments to your message.
    Hopefully, these two deficiencies will be rectified in future releases!
    </quote>
    The entire email sending code with attachments is freely available from Oracle (sitting on top of utl_smtp package). No need to buy additional software.

Maybe you are looking for