Email from database hang's up.

Hello ,
ORACLE 10g R2
Windows Server 2008 64-Bit
SMTP server - smtp.gmail.com
I want to send emails from the DB & i am following the steps given below ...
I have logged in as user - SYS AS SYSDBA
Step 1: Install UTL_MAIL package
To install the UTL_MAIL package, run the below files as user "SYS"
$ORACLE_HOME/rdbms/admin/utlmail.sql
$ORACLE_HOME/rdbms/admin/prvtmail.plb
Step 2: Set SMTP_OUT_SERVER parameter
SQL> ALTER SYSTEM SET smtp_out_server=’smtp.domain.com’ SCOPE=both;
Step 3: Grant permissions +( I know this step should have been 2nd , but i don't think it will be a problem)+
Grants the execute permission on UTL_MAIL privilege to PUBLIC or the user which will use the package. Run the beow command as user “SYS”
SQL> GRANT EXECUTE ON UTL_MAIL TO PUBLIC;
Step 4: Create procedure to send email
CREATE OR REPLACE PROCEDURE test_email AS
BEGIN
UTL_MAIL.SEND(sender => '[email protected]',
recipients => '[email protected]',
cc => '[email protected]',
bcc => '[email protected]',
subject => 'Test Mail',
message => 'Hi, This is just a test mail');
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(-20001,'The following error has occured:' ||sqlerrm);
END;
SQL> exec test_email;
As i fire the above command , my server shows me the query is executing for along time . I have waited for 30-40 mins ..... but no effect , no output & most importantly .... no email in my inbox....
I have also set the smtp_out_server in my init.ora file ....
where am i mistaken ????? please guide me if i am wrong ...
Thanks in advance ...

Looks like there are 2 issues here.
Firstly, Gmail would require SMTP authentication (As would any 3rd party SMTP server that didn't want to be a full time SPAM relay), which neither UTL_MAIL or UTL_SMTP handle 'out of the box'. This thread has a few pointers Re: SMTP Password required
Also looks like Gmail requires SSL connections http://mail.google.com/support/bin/answer.py?hl=en&answer=13287 . I found this article http://monkeyonoracle.blogspot.com/2009/11/plsql-and-gmail-or-utlsmtp-with-ssl.html that appears to have a workaround, can't vouch for if it works though.
It's all getting quite messy to set up though, as you can see. Do you not have any sort of local SMTP server that you could use?
Edited by: Carlovski on Jul 19, 2010 2:44 PM
Edited by: Carlovski on Jul 19, 2010 2:44 PM

Similar Messages

  • Sending email from database version 8.0.5

    Hi!
    We are current using Oracle Database 8.0.5. How can we send email using PL/SQL?
    utl_smtp is not yet available i think for this database version? what is the alternative? How do we use/install this alternative.
    Please help. Thanks.
    Erick

    Here is our Oracle version from SQL*Plus:
    SQL> select * from v$version;
    BANNER
    Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
    PL/SQL Release 8.1.5.0.0 - Production
    CORE Version 8.1.5.0.0 - Production
    TNS for 32-bit Windows: Version 8.1.5.0.0 - Production
    NLSRTL Version 3.4.0.0.0 - Production
    I got this error from my procedure:
    PLS-00201: identifier 'UTL_SMTP.CONNECTION' must be declared
    Is this version not enough to run UTL_SMTP?

  • Group Emails from database

    I use Bento to maintain two large databases of group contacts. Mavericks will no longer allow me to copy the email address column and paste to the To: CC: BCC: in Mail as in the past. Any solutions?

    Great,
    So, now, open Automator, and click "Service"
    Choose Service receives seleted text in Bento
    Select Utilities->Copy to Clipboard
    Select Utilities->Run Shell Script and enter the above command (in place or cat):
    Select Mail->New Mail Message
    Save
    Now, highlight the email addesses in Bento, right click, and select the service you just created.
    A new mail window will open, and just ⌘V

  • Sending email from database

    Hello,
    I created a procedure for sending email and it is working fine and i receive emails..
    Only, I can't get the sender and the reciptient with the subject of the email.
    CREATE OR REPLACE PROCEDURE send_mail
    ( sender IN VARCHAR2,
    recipient IN VARCHAR2,
    subject IN VARCHAR2,
    message IN VARCHAR2)
    IS
    mailhost VARCHAR2(30) := 'send.columbia.edu';
    mail_conn utl_smtp.connection;
    crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    mesg VARCHAR2( 1000 );
    BEGIN
    mail_conn := utl_smtp.open_connection(mailhost, 25);
    mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
    'From: <'||sender||'>' || crlf ||
    'Subject: '||subject || crlf ||
    'To: '||recipient || crlf ||
    '' || crlf || message;
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, '[email protected]');
    utl_smtp.rcpt(mail_conn, '[email protected]');
    utl_smtp.data(mail_conn, 'mesg');
    utl_smtp.quit(mail_conn);
    END;
    thanks in advance,
    Aysha,

    I add the two lines before "utl_smtp.Quit(v_mail_conn);" in my procedure:
    utl_smtp.write_data(mailCONN, 'CC: '||mailFROM || chr(13));
    utl_smtp.write_data(mailCONN, 'BCC: '||mailFROM || chr(13));
    DECLARE
    v_From VARCHAR2(80) := '[email protected]';
    v_Recipient VARCHAR2(80) := '[email protected]';
    v_Subject VARCHAR2(80) := 'test subject';
    v_Mail_Host VARCHAR2(30) := 'mail.mycompany.com';
    v_Mail_Conn utl_smtp.Connection;
    crlf VARCHAR2(2) := chr(13)||chr(10);
    BEGIN
    v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
    utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
    utl_smtp.Mail(v_Mail_Conn, v_From);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
    utl_smtp.Data(v_Mail_Conn,
    'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
    'From: ' || v_From || crlf ||
    'Subject: '|| v_Subject || crlf ||
    'To: ' || v_Recipient || crlf ||
    crlf ||
    'some message text'|| crlf || -- Message body
    'more message text'|| crlf
    utl_smtp.write_data(mailCONN, 'CC: '||v_From || chr(13));
    utl_smtp.write_data(mailCONN, 'BCC: '||v_From || chr(13));
    utl_smtp.Quit(v_mail_conn);
    EXCEPTION
    WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
    raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
    END;
    The procedure is compiled well, but by doing
    execute send_mail(from_mail, to_mail,cc_mail,bcc_mail,subject, body);
    I got 29277. invalid SMTP operation
    cause: The smtp operation was invalid at the current stage of the smtp transaction
    Thanks for your assistance,
    Aysha

  • 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?

  • E-Mail Generating from database error ORA-06502: PL/SQL:

    Hello,
    I have write script for generating HTML formated email from database (11g).
    when text body increase 4000 char it generating error
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "EXPORT.REALIZATIONHTML", line 56 ORA
    how i can resolve it.
    I also try with LONG
    Thanks

    Thanks for reply.
    I try with CLOB, Reason is that message body have almost 1000 recode and length(message) have more than 8000 characters even more than 10000
    how i can resolve it , which data type I have to use
    Thanks

  • Email from oracle application

    Hello,
    I have account with google apps. with that email acount I would like gen emails from database and send thru google apps gmail acccount. Plz. help me with SMTP setuo on util mail. I am using ORACLE 10g

    1. Logon to OAM (Oracle Application Manager):
    - Site Map > Press the link Monitoring > Current Activity > System Alerts > Notifications Setup > Create >Single Application > Press Continue button >
    2. For the Application select: Application Object library.
    3. For the Component Name: you can select any of the manager, for example “Standard Manager”
    4. Select the Person to Notify.
    5. Press Submit.

  • Sending an email from my database

    Hi!
    I wanna send an email from within a procedure from my database, Im thinking of using the utl_smtp package, I know I need acces from my database server to the smtp server, that can be done... when u use the utl_smtp package u need to specify the smtp host, the email address of the sender, the email address of the receptor, and some other stuff, what I wonder is: Where do u specify the password of the email address of the sender?, I mean, it doesnt make sense that u use an email address to send an email and u dont specify the password of that account
    In all the samples Ive seen all over internet I havent found something that tells me something about it...
    Any Help???

    A lot of smtp servers do not require a username/password when sending mail, only when receiving mail.
    If you need verification, you can do it with utl_smtp:
    utl_smtp.command( conn, 'AUTH LOGIN'); 
    utl_smtp.command( conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( cuser ))) ); 
    utl_smtp.command( conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( cpassword ))) ); 

  • Outlook 2010 hangs when opening emails from a certain sender

    I have a problem when we a receive a notification email from a certain sender.  The email is actually from an internal address within the company.  We receive email notifications when we receive a voice mail on our phone system and that email
    is what is causing the problems.  The email we receive is very basic and just has a small amount of text saying "IP Office Voicemail redirected message".  When I try to open the email (or view when the reading pane is enabled) it hang Outlook
    for about 20-30 seconds.  This happens with every notification email we receive from that address.  I tried locking up Outlook when it was hanging to see if I could get any error messages.  In Event Viewer I got this:
    "The program OUTLOOK.EXE version 14.0.7113.5000 stopped interacting with Windows and was closed. To see if more information about the problem is available, check the problem history in the Action Center control panel."
    Things I have tried:
    Clean install (of both Office and Windows)
    Removing and recreating the Outlook profile
    Setting Outlook to "Read all standard mail in plain text"
    Updating Windows/Office
    Setting our voice mail server to send from a different email address
    Opening Outlook in safe mode
    We are on a domain with Exchange.  This started happening a couple of months ago.
    Any ideas as to what I can try next?
    Thanks.

    Hi JW_IC,
    Does this issue occur OWA?
    If OWA not hangs, it seems an issue on the Outlook client side.
    I found that you have done all operations on the Outlook client side and still not worked.
    How about following the error message, "To see if more information about the problem is available, check the problem history in the Action Center control panel",
    to check the problem in the Action Center control panel. Please paste the details without sensitive information for the further troubleshooting.
    I suggest updating Outlook 2010 to the latest version for test.
    Thanks
    Mavis
    Mavis Huang
    TechNet Community Support

  • Some emails from a particular sender causing Outlook 2010 to hang, task manager shows memory use spikes

    Posting this to the Exchange forum because I'm hoping there's a server-side solution.
    SOME emails received from an external sender (gmail.com address, not sure the mail client) are causing Outlook 2010 to hang when trying to open the email.  Outlook becomes non-responsive when viewing the email through the preview pane or by double-clicking
    the email.  If I open Task Manager I see that the outlook.exe process memory use starts increasing very quickly.  As far as I know the only resolution is to end the task and re-open Outlook (and avoid that email).
    I've found several excellent threads on these same symptoms, but there seems to be a variety of causes.  I've tried a bunch of things so far:
     - Tried opening from another system on our network running Outlook 2010, same issue. 
     - Tried opening from OWA, opens fine.
     - Tried exporting the email to a PST, then opening from a completely different system outside of our network, but still running Outlook 2010, same issue.
     - Tried exporting the email to a PST then opening from a completely different system outside of our network, running Outlook 2013, email opens fine.
     - Tried setting Outlook to open all emails as PLAIN TEXT, opens fine.
    Systems are running the latest Outlook 2010 SP and patches, and running a variety of OS's.  Only common denominator seems to be Outlook 2010.
    I was hoping to find a way to convert incoming emails from this sender to open as Plain Text using a Hub Transport rule, but cannot find a way to do it.
    Unfortunately I have no control over the sender, so don't know what could be triggering the problem.  
    Can anyone advise on a possible solution?  Any way to someone convert emails from a particular sender to Plain Text automatically?

    Either you inform the sender to configure in sender's outlook to send only to you in plain text please check this
    http://office.microsoft.com/en-001/outlook-help/change-the-message-format-to-html-rich-text-or-plain-text-HA101992313.aspx
    Or
    Call a macro in your outlook example below. Please check
    this for details
    Dim msg As MailItem
    For Each msg In myNS.GetDefaultFolder(olFolderInbox).Items
       If msg.Unread = True And _
         msg.SenderName = "Linda Cooper" Then
    Item.BodyFormat = olFormatPlain
       Else
         ' Message doesn't meet criteria.
       End If
    Thanks,
    MAS
    Please mark as helpful if you find my comment helpful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

  • Mail hang when getting email from multiple POP accounts

    I'm posting this issue again.
    Mail hangs while getting new mail from multiple POP accounts almost every time. When it does, only Force Quit can quit it.
    The following DID NOT fix the hang:
    - Reconstructing all mail boxes
    - Exporting, deleting and reimporting all mail boxes
    - Disabling all rules
    - Deleting anti-spam history
    - Deleting all emails from all mail boxes
    Testing each POP account individually while putty the other two offline works fine.
    I also noticed that sometimes the new mail counter in Inbox displays 2-4 new messages while there is no new ones. Switching boxes/folders and back to Inbox fixes it.
    The POP accounts are:
    One plain text POP
    One secure POP
    One GMail POP
    Can anyone help?

    You’re welcome.
    I did try to clear the junk mail preferences
    The Junk Mail preferences cannot be “cleared”. What do you mean?
    it crashes almost every single time.
    It doesn’t crash (i.e. quit unexpectedly). It freezes (i.e. becomes unresponsive), right?
    I transfered my data to a Mac Mini. I had the same exact problem on it too!
    so it seems it has nothing to do with the OS plugins or the setup I have.
    Well, that would depend on what exactly does “I transfered my data” mean...
    Try first disabling all the rules in Preferences > Rules AND the junk filter in Preferences > Junk Mail. If the problem persists, proceed as follows.
    Verify/repair the startup disk (not just permissions), as described here:
    The Repair functions of Disk Utility: what's it all about?
    After having fixed all the filesystem issues, if any, and ensuring that there’s enough space available on the startup disk (a few GB, plus the space needed to make a backup copy of the Mail folder), try this:
    1. Quit Mail if it’s running.
    2. In the Finder, go to ~/Library/Mail/. Make a backup copy of this folder, just in case something goes wrong, e.g. by dragging it to the Desktop while holding the Option (Alt) key down. This is where all your mail is locally stored.
    3. Locate Envelope Index and move it to the Trash. If you see any other “Envelope Index”-named file there, delete it as well.
    4. Move any “IMAP-”, “Mac-”, or “Exchange-” account folders to the Trash. Note that you can do this with IMAP-type accounts because they store mail on the server and Mail can easily re-create them. DON’T trash any “POP-” account folders, as that would cause all the mail stored there to be lost.
    5. Open Mail. It will tell you that your mail needs to be “imported”. Click Continue and Mail will proceed to re-create Envelope Index — Mail says it’s “importing”, but it just re-creates the index if the mailboxes are already in Mail 2.x format.
    6. As a side effect of having removed the IMAP account folders, those accounts may be in an “offline” state now. Do Mailbox > Go Online to bring them back online.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e. /Users/username/Library.

  • Help to resolve error in sending database email from SQL Server 2012.

    Please help to resolve error in sending email from SQL Server 2012.
    SQL Instance Version:
    Microsoft SQL Server 2012 (SP1) - 11.0.3449.0 (X64) 
    Jun 29 2014 23:15:18 
    Copyright (c) Microsoft Corporation
    Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: )
    Error Message: Error MeThe mail could not be sent to the recipients because of the mail server failure. (Sending Mail using Account 1 (2015-01-15T19:48:25). Exception Message:
    Cannot send mails to mail server. (The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated).)

    The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1
    Client was not authenticated).
    I think the error message is pretty clear, you have to setup authentication for the SMTP connection in Database Mail, see
    Database Mail Configuration Objects
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • After upgrading to Firefox 4.0.1, it no longer will open external links - anything from emails, IMs, databases won't open - how can I fix this?

    No links from external programs will open - this is usually kind of ok since I can cut and paste, but some links from databases don't provide copy-able links, meaning I cannot access information via Firefox.

    Hi BladedxRayne,
    You should look at the article [http://kb.mozillazine.org/Preferences_not_saved Preferences not saved].
    Hopefully this helps!

  • Oracle 10g Database Hanging twice a day

    My database server has 10g with MS 2003 server as OS.
    Twice a day the database hangs and does disconnects all the users from local and remote locations.
    Current SYSTEM tablespace has a size of 470 MB and is 98.86 in use, when I try to add another datafile as 'SYSTEM02.DBF' in the same path where other system data files are, I kept this operation running during weekends but datafile was not added.
    Has it anything to do with the MS 2003 server no. of users.
    Any other suggestions for SYSTEM Tablespace to be free.
    Please reply.
    Thanks
    Ajaz Ahmed

    Hi friends / sameer,
    Sorry for the delay. Here is the attached alert.log file Since the data from foxpro was loaded into oracle on to oracle 10 g from 7th may the problem of database hanging started from the next day. I joined the organization on 22nd july.
    Current SYSTEM tablespace has a size of 470 MB and is 98.86 in use, when I try to add another datafile as 'SYSTEM02.DBF' in the same path where other system data file is, it does not add. I kept this operation running during weekends but datafile was not added.
    Has it anything to do with the MS 2003 server no. of users.
    Any other suggestions for SYSTEM Tablespace to be free.
    If you can get me your mail id then I can send the
    attachment of alert.log file as [email protected] bounces back.
    Thanks
    Ajaz Ahmed

  • Cannot send email from Exchange 2007 to Exchange 2013 - Coexistence

    Existing Exchange 2007 SP3 1 MBX, 2 CAS/HT, 2 ET servers.
    I have added an Exchange 2013 server with MBX/CAS role.
    Email will flow from Ex2013 server no problem.  Mail from Ex2007 systems cannot deliver to Ex2013 boxes, it dies in queue with a 4.4.7 expired message after issuing a delay message.
    I can telnet to ports 25, 587,717,465,475, and 2525 from Ex2007 HT role to new Exchange 2013 server.  I can send email from Ex2007 HT role server to new Exchange 2013 server using telnet to port 25.
    A ‘get-mailbox’ from the Ex2007 HT role server returns the server and database properly on the test users on Exchange 2013 server.
    The only strange thing I am seeing is from the Ex2007 systems, a ‘get-exchange server’ command shows the new Ex2013 server as role ‘16439’ which looks to perhaps be normal.
    Why is email not flowing to the new users on Exchange 2013?

    You should have exchange server authentication ticked in Default Receive connector in Exchange2007.
    Exchange 2007 and Exchange 2013 in the same subnet/network. if not please check any spam agent running between the networks. Are you running antispam on Exchange2013 ?
    MAS

Maybe you are looking for

  • With Knoll Light Factory how do you get rid of the pinpoint of light that overlap obscuration layer?

    I have KLF 3.0 on AE CS6, I am trying to add a nice flare to some keyed footage of a rock star for music video... I set it up so it looks like a light is behind him and I want him to obscure it a bit when he moves around... However, I can't get rid o

  • MapViewer tile layer preview error in OBIEE 11.1.1.7

    Some folks have run into an issue when previewing tile layers in the manage tile layers page of MapViewer in obiee 11.1.1.7 (i.e. in the mapviewer deployed on wls in obiee). If you get a 500 - internal server error when trying to view map/manage tile

  • Does anyone know the maximum hard drive size for a 2007 Macbook Pro (A1226)?

    I have a 2007 Macbook Pro (A1226). Is there a limit to the sized hard drive that can be installed? If so, what is the largest hard drive I can put into it? I have a 500GB HD that I upgraded to from the 320 GB that was in it when I bought it. I'm now

  • Export Time column to Excel

    I know SSRS doesn't really have a time data type outside of the datetime type, but I'm trying to have a time column which exports to excel as a time data type.  I've tried a few different ways, but the only way that seems to convert over is having th

  • Unable to build perl-net-pcap

    Hi, I just do successful full system upgrade. Some of written by me apps needs perl-net-pcap. Unfortunately no matter what - I'm not able successfully build perl-net-pcap package. PKGBUILD is following: # Maintainer: Alessandro Nakamuta <alessandro d