Check E-mail using PL/SQL

Hi!
Can I check e-mail address to use PL/SQL?

It's easy enough to check that a vaild e-mail has been entered by using regular expressions to check the mask. However, I fear that using SMTP to perform online validation is not a viable proposition.
By its very nature, e-mail is asynchronous: you have to send an e-mail and wait for it to be either bounced or acknowledged. Certainly, if you're intending to do this over IP you may have a long wait. Furthermore, what if the user's e-mail service is temporarily down. Besides, if a user wants to, they could use one of the e-mail services that provide disposable, one-use addresses.
To actually answer your question :)
PL/SQL has an e-mail package - UTL_SMTP - that's good for automatically generating and sending e-mail messages from within the database. As you want to do something more sophisticated I think you'll need to investigate an OS based solution or build an application using JavaMail.
Cheers, APC

Similar Messages

  • How to send e-mail using PL/SQL

    I need to send e-mail using PL/SQL. Is it possible?
    Thanks in advance,
    Agnaldo

    Yes. Use the UTL_SMTP package

  • Retrive perticular mail using PL-SQL procedure

    Hi all,
    Anyone knows, how to retrive mails from outlook using PL-SQL procedure?
    Thanks and Regards
    Nilay

    The Java library needed by UTL_TCP is not created properly. You may just run $ORACLE_HOME/rdbms/admin/initplsj.sql as SYS to install it:
    cd $ORACLE_HOME/rdbms/admin
    sqlplus sys/<sys-password> @initplsj.sql

  • MAIL USING PL/SQL PROCEDURE TCP CONNECTION ERROR

    I was trying to send an e-mail using the demo-mail helper package which uses UTL_SMTP package and on execution, it gives the following TCP Connection error. Is it some something to do with mail configuration?
    This is the sample code I was trying to run.
    demo_mail.mail( sender => 'Me <[email protected]>',
    recipients => 'Someone <[email protected]>, ' ||
    '"Another one" <[email protected]>',
    subject => 'Test', message => 'Hi! This is a test.');
    And this is the error I am getting.
    class oracle/plsql/net/TCPConnection does not exist
    at "SYS.UTL_TCP", line 537
    at "SYS.UTL_TCP", line 199
    at "SYS.UTL_SMTP", line 102
    at "SYS.UTL_SMTP", line 121
    at "VNARAYA.DEMO_MAIL", line 159
    at "VNARAYA.DEMO_MAIL", line 119
    at "VNARAYA.DEMO_MAIL", line 105
    at "VNARAYA.SEND_MAIL", line 2
    at line 1

    The Java library needed by UTL_TCP is not created properly. You may just run $ORACLE_HOME/rdbms/admin/initplsj.sql as SYS to install it:
    cd $ORACLE_HOME/rdbms/admin
    sqlplus sys/<sys-password> @initplsj.sql

  • Problem when "Checking for Mail" using IMAP and POP

    Hello,
    I have an iPhone 3G running 2.0.1 and created 3 mail accounts (1 Gmail using IMAP, and 2 using POP).
    When I first set up the phone 2 days ago the installer copied the settings from my Mac and emails on my iPhone showed up correctly.
    Since yesterday something is screwed up because when I try to fetch new email I only see "Checking for Mail" at the bottom of the screen but nothing happens and new emails don't show up.
    Any idea how to fix this problem?
    Thanks!

    FYI you don't actually have to completely reboot the phone. From inside your email program, push and hold the HOME button for 7 or 8 seconds until it exits email and dumps you back at your home screen. That causes a hard-quit of the email program and will reset it. You should begin getting email again immediately after.
    Here's hoping Apple fixes that anomaly on their next release...

  • Check the hints used in SQL Query (Parallel, First_Rows)

    Hi,
    I have used above hints in my sql query and found no difference in execution time.
    I just want to know whether the hints are used in my sql are not.
    Could you please let me know where to check for it.
    Thanks in advance

    Can you post the SQL which uses these hints and the execution plan with and without those hints here? Then only community can help you find out if the hints are really used or not.
    Please use code tags to preserve the format of execution plan.
    Edited by: Satish Kandi on Jun 23, 2009 5:37 PM

  • Email Configuration using PL/SQL

    Dear All,
    I am trying to send a mail using pl/sql package, but mail is not going, its throwing the below error.
    The configured ip is 192.168.5.44 . The same i am calling in the procedure
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 20
    ORA-06512: at "SYS.UTL_SMTP", line 96
    ORA-06512: at "SYS.UTL_SMTP", line 138
    ORA-06512: at "APPS.XX_SEND_MAIL", line 21
    ORA-06512: at line 2
    If anyone provide a solution it will be much helpful.
    Coding used:
    CREATE OR REPLACE PROCEDURE APPS.xx_send_mail (
    p_to IN VARCHAR2,
    p_from IN VARCHAR2,
    p_subject IN VARCHAR2,
    p_text_msg IN VARCHAR2 DEFAULT NULL,
    p_html_msg IN VARCHAR2 DEFAULT NULL,
    p_smtp_host IN VARCHAR2,
    p_smtp_port IN NUMBER DEFAULT 25
    AS
    l_mail_conn UTL_SMTP.connection;
    l_boundary VARCHAR2 (50) := '----=*#abc1234321cba#*=';
    BEGIN
    utl_tcp.close_all_connections;
    dbms_output.put_line('first begin ');
    l_mail_conn := UTL_SMTP.open_connection (p_smtp_host, p_smtp_port);
    dbms_output.put_line('before smtp host ');
    UTL_SMTP.helo (l_mail_conn, p_smtp_host);
    dbms_output.put_line('before from ');
    UTL_SMTP.mail (l_mail_conn, p_from);
    dbms_output.put_line('before second begin ');
    begin
    dbms_output.put_line('before to mail address ');
    UTL_SMTP.rcpt (l_mail_conn, p_to);
    dbms_output.put_line('after to mail address ');
    exception
    when others then
    dbms_output.put_line('sqlcode '||sqlcode||' '||' sqlerrm '||sqlerrm);
    end;
    dbms_output.put_line('after exception');
    UTL_SMTP.open_data (l_mail_conn);
    UTL_SMTP.write_data (l_mail_conn,
    'Date: '
    || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24:MI:SS')
    || UTL_TCP.crlf
    UTL_SMTP.write_data (l_mail_conn, 'To: ' || p_to || UTL_TCP.crlf);
    --UTL_SMTP.write_data (l_mail_conn, 'Cc: ' || p_cc || UTL_TCP.crlf);
    UTL_SMTP.write_data (l_mail_conn, 'From: ' || p_from || UTL_TCP.crlf);
    UTL_SMTP.write_data (l_mail_conn, 'Subject: ' || p_subject || UTL_TCP.crlf);
    UTL_SMTP.write_data (l_mail_conn, 'Reply-To: ' || p_from || UTL_TCP.crlf);
    UTL_SMTP.write_data (l_mail_conn, 'MIME-Version: 1.0' || UTL_TCP.crlf);
    UTL_SMTP.write_data (l_mail_conn,
    'Content-Type: multipart/alternative; boundary="'
    || l_boundary
    || '"'
    || UTL_TCP.crlf
    || UTL_TCP.crlf
    IF p_text_msg IS NOT NULL
    THEN
    UTL_SMTP.write_data (l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
    UTL_SMTP.write_data
    (l_mail_conn,
    'Content-Type: text/plain; charset="iso-8859-1"'
    || UTL_TCP.crlf
    || UTL_TCP.crlf
    UTL_SMTP.write_data (l_mail_conn, p_text_msg);
    UTL_SMTP.write_data (l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
    END IF;
    IF p_html_msg IS NOT NULL
    THEN
    UTL_SMTP.write_data (l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
    UTL_SMTP.write_data (l_mail_conn,
    'Content-Type: text/html; charset="iso-8859-1"'
    || UTL_TCP.crlf
    || UTL_TCP.crlf
    UTL_SMTP.write_data (l_mail_conn, p_html_msg);
    UTL_SMTP.write_data (l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
    END IF;
    UTL_SMTP.write_data (l_mail_conn,
    '--' || l_boundary || '--' || UTL_TCP.crlf
    UTL_SMTP.close_data (l_mail_conn);
    UTL_SMTP.quit (l_mail_conn);
    END;

    hi
    am also facing the same problem.
    procedure is
    CREATE OR REPLACE PROCEDURE send_mail (p_to        IN VARCHAR2,
                                           p_from      IN VARCHAR2,
                                           p_message   IN VARCHAR2)
    AS
      l_mail_conn   UTL_SMTP.connection;
      l_reply utl_smtp.reply;
      l_smtp_host VARCHAR2(50) := 'smtp.gmail.com:25';
      l_smtp_port NUMBER := 25; 
    BEGIN
      l_mail_conn := UTL_SMTP.open_connection(l_smtp_host, l_smtp_port);
      utl_smtp.EHLO(l_mail_conn, l_smtp_host);
      utl_smtp.command(l_mail_conn, 'AUTH LOGIN');
      utl_smtp.command(l_mail_conn, utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('[email protected]'))));
      utl_smtp.command(l_mail_conn, utl_raw.cast_to_varchar2(utl_encode.base64_encode(utl_raw.cast_to_raw('mypwd'))));
      l_reply :=UTL_SMTP.mail(l_mail_conn, p_from);
      dbms_output.put_line( l_reply.code || ' ' || l_reply.text );
      UTL_SMTP.rcpt(l_mail_conn, p_to);
      UTL_SMTP.write_data(l_mail_conn, p_message || UTL_TCP.crlf || UTL_TCP.crlf);
      UTL_SMTP.quit(l_mail_conn);
    END;
    /am calling as follows
    declare
    conn        utl_smtp.connection;
    smtp_domain VARCHAR2(256) := null;
    BEGIN
    utl_smtp.command(conn,'STARTTLS');
    utl_smtp.helo(conn, smtp_domain);
       send_mail(p_to        => '[email protected]',
                 p_from      => '[email protected]',
                 p_message   => 'can i get message.');
    END;
    /and getting the error
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 21
    ORA-06512: at "SYS.UTL_SMTP", line 97
    ORA-06512: at "SYS.UTL_SMTP", line 159
    ORA-06512: at line 5i have checked in control panel that IIS is installed and SMTP is also setup.
    i am able to ping SMTP HOST thro' TELNET
    and i have changed the SMTP_OUT_SERVER parameter like
    ALTER SYSTEM SET SMTP_OUT_SERVER= 'smtp.gmail.com:25' scope = botham not getting any clue. is it because of using GMAIL server?
    oracle version 10g and Windows is XP - SP3
    thank you for any help
    Regards
    Karthik

  • TS3988 My icloud account is not verifying it says check my mail witch I have done and I get a message say your iPhone for has been used to set up and Icloud account but still can not use the icloud can anybody help me.

    My icloud account is not verifying it says check my mail witch I have done and I get a message say your iPhone for has been used to set up and Icloud account but still can not use the icloud can anybody help me.

    Be sure you are checking the email account that you used to set up the Apple ID you used to create the iCloud account.  Also, be sure to check your spam/junk folder as well as your inbox.  The email you should receive looks like the image below.  When you get it, click the Verify Now link.
    If it still isn't there, try going to https://appleid.apple.com, click Manage your Apple ID, sign in, click on Name, ID and Email addresses on the left, then to the right look for a link to resend the verification email.

  • How to send mail in PL/SQL using exchange server details.

    Hi Experts,
    Business user has provided us the exchange server details to send mails.How can I send mails thru PL/SQL using exchange server details.

    user595740 wrote:
    Business user has provided us the exchange server details to send mails.How can I send mails thru PL/SQL using exchange server details.Basic answer - not easily.
    Oracle supports the standard application protocol SMTP - it does not support a proprietary protocol like that used by Exchange that only works on the Windows operating system. It however provides you with the flexibility to code this yourself.
    If you for example use Microsoft MAPI (Mail Application Programming Interface), you can integrate it with PL/SQL using the external procedure (extproc) feature of Oracle.
    In a nutshell, extproc enables you to create PL/SQL wrappers for public DLL calls. I posted sample code that demonstrates this in {message:id=2271919}. The sample code is for calling a DLL interface on HP-UX, but the concept is identical on Windows.

  • How to use Pl/sql block to edit check user input

    Hi,
    Please advise on PL/SQL Block code that could be used to Check User input from within a Loop and proceed conditionally based upon User Supplied compliant Input. Thanks in advance.

    Hi,
    yakub21 wrote:
    You could use the ACCEPT to get user input and then assign the input to a variable that could then be verified.
    I believe that anything is possible because we don't yet have proof that it is not!
    I do have code that can accept user input. Is it PL/SQL code? Sybrand was clearly talking about PL/SQL:
    sybrand_b wrote:
    Pl/sql is for server side code, it is not a front end tool, and it is incapable of the functionality you describe.If you do have PL/SQL code that accepts user input, please post an example. A lot of people, including me, would be very interested.
    Pass the user-input value to a variable and then assign that value to another variable from within a Declare of a PL/SQL Block.
    The opportunity here is to figure a way to loop with user input until desired input is entered by the user before proceeding with the code. I'm using PL/SQL Block because I don't want the code to persist. I just want to run it as part of database configuration procedure. ThanksIt sounds like you're talking about SQL*Plus, which is a very poor tool for looping or branching.
    It's possible, but it's not pretty. The following thread shows one way of looping in SQL*Plus:
    Re: How to give the different values to runtime parameters in a loop?

  • I use google with firefox, everytime i open firefox and begin browsing or go to check my mail i get a firefox not responding error message on top left of screen. How do i get rid of this?

    Question
    I use google with firefox, everytime i open firefox and begin browsing or go to check my mail i get a firefox not responding error message on top left of screen. How do i get rid of this?

    Hi,
    Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode.]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]
    [http://support.mozilla.com/en-US/kb/Uninstalling+add-ons Uninstalling Add-ons]
    [http://kb.mozillazine.org/Uninstalling_toolbars Uninstalling Toolbars]

  • Am I supposed to use iCloud to check my mail now?

    Am I supposed to use https://www.icloud.com to check my e-mail, both on my iMac and my iPhone?  I am confused.  Apple usually makes things so easy to do, and this is one of the most complicated installs I have ever done.  This makes installing updates to Windows 3.5 EASY!! 

    You check your mail in your mail application, just as you have always done, iCloud is just somewhere else you can check it if you aren't at your own computer and don't have your phone with you.

  • Sending Mail through Outlook using PL/SQL

    I have installed Oracle 9i (9.2.0.1) on Windows Xp with SP 2 platform. My MS Outlook has been configured.
    How could i send mail through Microsoft outlook by using PL/SQL Program.

    How could i send mail through Microsoft outlook by using PL/SQL Program.Nonsensical question. MS Outlook is a mail client. A PL/SQL program is also a mail client.
    Both these need to talk to a mail server. It does not make sense for one mail client to "+talk+" to another client for passing it e-mails that need to be send.
    The mail client talks to a mail server using the SMTP ( Simple Mail Transfer Protocol ). There are also other protocols such as IMAP (open standard) and MAPI (Microsoft proprietary).
    Oracle's PL/SQL environment by default supports SMTP via the UTL_SMTP, and UTL_MAIL packages - these provide the PL/SQL developer with an interface to use to send e-mails.
    MS Outlook (client) does not feature anywhere in this regard, whereas MS Exchange as a mail server will (assuming it is being used on your network).

  • Checking for every record in a table using PL/SQL

    Hello Gurus,
    I would need your help in finding the best approach to tackle the below analysis using PL/SQL.
    I have a table which contains two columns
    UserID and Month
    I want to find out the users who made orders every month for the first half of 2012.That is the User ordered on Jan 2012, Feb2012 ... and June 2012.
    The Table is huge and has more than a million records. How do I approach this in PL/SQL.
    Joe

    Hi Justin,
    Thanks for the quick response. This is helpful.However my Intention is to do it using PL/SQL for learning purposes. I am new to PLSQL.
    I wanted to do something like looping through each records in the table for every user ID and If I find orders for six consecutive months for a particular user, I will insert the user id to a temp table.
    Any hints on how can I use this? I heard about cursor. Can I use it. If so how should I approach.
    --Joe                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Capture mail with Attachment from POP server using PL/SQL

    Hey guys,
    With the help of this forum and Billy I am able to capture the email from POP3 server and display it to the user. But my query is how can I get an Attachment from the email using PL/SQL's UTL-TCP method ? Right now it displays some encrypted code.
    Thanks.

    Hey guys,
    With the help of this forum and Billy I am able to capture the email from POP3 server and display it to the user. But my query is how can I get an Attachment from the email using PL/SQL's UTL-TCP method ? Right now it displays some encrypted code.
    Thanks.

Maybe you are looking for

  • "Good" mail going into Junk folder

    For the last 2-3 weeks I have started seeing my "good" mail, get delivered to my junk folder. This is mail that I've been receiving for months or even years. None of this mail is personal: some of it is from politicians, some are recipes, one was my

  • I want only one Apple acct....please!

    I have 4 Apple related accounts: 2 "apple.com", 1 "daw.apple.com", 1 "secure1.store.apple.com" How can I have only one acct. for Apple,  iTunes, Cloud, etc.?

  • SOLVED! E_ADEPT_REQUEST_EXPIRED - if you're on a mac, anyway....

    i did a lot of research. if you get that annoying message when you tried to activate, try this:  (http://support.apple.com/kb/TS2538) Symptoms Mac OS X may display the incorrect time when "Set date & time automatically" is enabled in the Date & Time

  • How does derived class access mx_internal namespace ?

    Hi, I've been struggling with the PopUpButton for a day now.. Just trying to move the popup location. Since I can't get moving the PopUpButton into my directory and have it find the icons, I'm attempting to subclass PopUpButton. Some of the methods i

  • No audio from clips

    I just downloaded the Trial version of Adobe Premiere Pro CS5 and when I import a clip, i'm not getting any audio, not even anything showing up in the 'Audio Master Meter' I do get audio when I import a .mp3 file HELP pleeease, this is very irritatin