Procedure for Simple Mail from Forms

Hi All,
Is there any procedure to send simple email without
attachment from forms 9i like we have the feature in oracle reports.
1.Not using OLE i mean outlook.
2.Neither calling report.

First you must:
============================================================
v_mailconn utl_smtp.connection;
v_hostname VARCHAR2(64);
v_mailhost VARCHAR2(64):= 'mail.smtphost.com' -- note ***this is not a real mail hostname***
SELECT host_name INTO v_hostname FROM V$INSTANCE;
v_mailhost := v_hostname||'.'||v_mailhost;
v_mailconn := utl_smtp.open_connection(v_mailhost, 25);
utl_smtp.helo (v_mailconn, v_mailhost);
-- next call: se below for procedure
send_mail_to_user(v_mailconn, v_mailhost, p_email, v_subject,
v_message1, v_message2, p_message);
utl_smtp.quit (v_mailconn);
============================================================
PROCEDURE send_mail_to_user (p_mailconn IN OUT utl_smtp.connection,
p_mailhost VARCHAR2, p_email VARCHAR2,
p_subject VARCHAR2, p_message1 VARCHAR2,
p_message2 VARCHAR2, p_message3 VARCHAR2) IS
BEGIN
-- send mail to a single user, assume the connection has already been opened
utl_smtp.mail (p_mailconn, p_mailhost);
utl_smtp.rcpt (p_mailconn, p_email);
utl_smtp.open_data (p_mailconn);
utl_smtp.write_data (p_mailconn,
'To: ' ||'<'||p_email ||'>'|| utl_tcp.crlf ||
'From: ' ||'My Automated EMail System' || utl_tcp.crlf ||
'Subject:'|| p_subject || utl_tcp.crlf ||
'Date:' ||TO_CHAR(NEW_TIME(SYSDATE,'PDT','GMT'),'DD Mon YY HH24:MI:SS')||utl_tcp.crlf);
utl_smtp.write_data (p_mailconn, utl_tcp.crlf || utl_tcp.crlf ||
' -----------------------------------------------' || utl_tcp.crlf ||
' | This is an automatically generated email |' || utl_tcp.crlf ||
' | |' || utl_tcp.crlf ||
' | Do not reply to INFADS Automated EMail System |' || utl_tcp.crlf ||
' -----------------------------------------------' || utl_tcp.crlf ||utl_tcp.crlf);
utl_smtp.write_data (p_mailconn, p_message1 || utl_tcp.crlf || utl_tcp.crlf);
utl_smtp.write_data (p_mailconn, p_message3 || utl_tcp.crlf || utl_tcp.crlf);
utl_smtp.write_data (p_mailconn, p_message2 || utl_tcp.crlf);
utl_smtp.close_data (p_mailconn);
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE = -29279 THEN -- (User Unknown)
NULL;
ELSE
RAISE_APPLICATION_ERROR(-20000, 'send_mail_to_user: '||SQLERRM);
END IF;
END;

Similar Messages

  • Send mail from forms 6i

    Do you know how to send mail from forms?
    Thank you

    UTL_SMTP
    UTL_SMTP is designed for sending e-mail over Simple Mail Transfer Protocol (SMTP). It does not have the functionality to implement an SMTP server for mail clients to send e-mail using SMTP.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_smtp.htm#ARPLS074
    Joel Pérez

  • NEED TO SEND MAIL FROM FORMS...

    DEAR ALL,
    I NEED TO SEND MAIL FROM FORMS WHEN I PRESS THE MAIL BUTTON.
    I HAVE NO IDEA FOR THIS CRITERIA. IF ANY ONE EXPERIENCED WITH
    THIS CRITERIA, PLS HELP ME AND GIVE ME THE CODING FOR THAT.
    AND ALSO PLS EXPLAIN EACH LINE OF CODING, WHICH U POST.
    THANKS IN ADVANCE
    S.BERNANDAS

    Your requirement can be done in forms. Good amounts of advice here. There 244 messages this year alone that fit the search criteria in the Oracle Forms forum.

  • Stored Procedures for Simple SQL statements

    Hi Guys,
    We are using Oracle 10g database and Web logic for frontend.
    The Product is previously developed in DotNet and SQL Server and now its going to develop into Java (Web Logic) and Oracle 10g database.
    Since the project is developed in SQL Server, there are lot many procedures written for simple sql queries. Now I would like to gather your suggestions / pointers on using procedures for simple select statements or Inserts from Java.
    I have gathered some list for using PL/SQL procedure for simple select queries like
    Cons
    If we use procedures for select statements there are lot many Ref Cursors opened for Simple select statements (Open cursors at huge rate)
    Simple select statements are much faster than executing them from Procedure
    Pros
    Code changes for modifying select query in PL/SQL much easier than in Java
    Your help in this regard is more valuable. Please post your points / thoughts here.
    Thanks & Regards
    Srinivas
    Edited by: Srinivas_Reddy on Dec 1, 2009 4:52 PM

    Srinivas_Reddy wrote:
    Cons
    If we use procedures for select statements there are lot many Ref Cursors opened for Simple select statements (Open cursors at huge rate)No entirely correct. All SQLs that hit the SQL engine are stored as cursors.
    On the client side, you have an interface that deals with this SQL cursor. It can be a Java class, a Delphi dataset, or a PL/SQL refcursor.
    Yes, cursors are created/opened at a huge rate by the SQL engine. But is is capable of doing that. What you need to do to facilitate that is send it SQLs that uses bind variables. This enables the SQL engine to simply re-use the existing cursor for that SQL.
    Simple select statements are much faster than executing them from ProcedureAlso not really correct. SQL performance is SQL performance. It has nothing to do with how you create the SQL on the client side and what client interface you use. The SQL engine does not care whether you use a PL/SQL ref cursor or a Java class as your client interface. That does not change the SQL engine's performance.
    Yes, this can change the performance on the client side. But that is entirely in the hands of the developer and how the developer selected to use the available client interfaces to interface with the SQL cursor in the SQL engine.
    Pros
    Code changes for modifying select query in PL/SQL much easier than in JavaThis is not a pro merely for ref cursors, but using PL/SQL as the abstraction layer for the data model implemented, and having it provide a "business function" interface to clients, instead of having the clients dealing with the complexities of the data model and SQL.
    I would seriously consider ref cursors in your environment. With PL/SQL servicing as the interface, there is a single place to tune SQL, and a single place to update SQL. It allows one to make data model changes without changing or even recompiling the client. It allows one to add new business logical and processing rules, again without having to touch the client.

  • How send mail from forms 10g

    hi all,
    can any help in this,
    i want send a mail from forms 10g,how???
    thanx in advace,
    chands

    hi,
    my oracle version is 10.1.0.4.2
    this is my code....
    PROCEDURE Send_Mail_001 (sender IN VARCHAR2,
    recipient IN VARCHAR2,
    subject IN VARCHAR2,
    message IN VARCHAR2)
    IS
    mailhost VARCHAR2(30) := '10.192.30.12';
    mail_conn utl_smtp.connection;
    TEST VARCHAR2(100);
    crlf VARCHAR2(2):= CHR( 13 ) || CHR( 10 );
    mesg VARCHAR2(2000);
    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);
    mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
    'From: ' || sender || crlf ||
    'To: ' || recipient || crlf ||
    'Subject: '|| subject || crlf;
    mesg:= mesg || ' ' || crlf || crlf || message ||'.' || crlf || '.'|| crlf;
    UTL_SMTP.OPEN_DATA(mail_conn);
    utl_smtp.write_data (mail_conn, mesg);
    /* body of email with multiple
    utl_smtp.write_data (v_mail_conn, v_message);
    call to write_data
    utl_smtp.write_data (mail_conn, mesg);
    UTL_SMTP.CLOSE_DATA(mail_conn);
    utl_smtp.quit(mail_conn);
    premia_wf_log('mail','hi');
    EXCEPTION
    WHEN OTHERS THEN
    premia_wf_log('mail',sqlerrm);
    END;
    can u help me in this..........
    thanx in advance
    chands

  • How to send mail from FORMS and PL/SQL

    I want to send a mail from forms + PL/sql.
    I do not want to create a new C program and to make it as USER_EXIT.
    The called function suppose to send it through the default email method as per the NT or UNIX setup.
    Thanks

    Thanks for your reply.
    It requires JServer. We have many clinets around the world and some of them are still running Oracle 7.3.
    Any other sleek solution?

  • Who send mail from Forms 6i Builder?????

    I need send mail from Forms 6i Builder
    Please help me.
    Write me to [email protected]
    thanks.

    I need send mail from Forms 6i Builder
    Please help me.
    Write me to [email protected]
    thanks.

  • I have an iphone 4 with videos on it that I'd like to transfer to an IMac so that I can email them.  (the iphone isn't in use anymore.)  What's the procedure for transfering videos from an iphone to an iMac?

    I have an iphone 4 with videos on it that I'd like to transfer to an IMac so that I can email them.  (the iphone isn't in use anymore.)  What's the procedure for transfering videos from an iphone to an iMac?

    Connect the iPhone to your Mac with its USB cable and launch iPhoto.  In iPhoto you can select which files to upload into the library.  Once in the library export them out of iPhoto to a folder on the Desktop via File ➙ Export ➙ File Export  with Kind=Original. That will give you copies of the videos in the folder for use outside of iPhoto.
    If you want to bypass importing into iPhoto try launching Image Capture and manually upload the selected video files to the folder of your choice.
    OT

  • How to send formatted mail from form 6i

    Hi,
    There is requirment in my project to send formatted mail from form 6i.The database used in 9i.In normal form we can send normal mail.However our requirment is such that the mail content should have company logao pics and it should display data in coloured format based on data fetched from database.How can this be done.
    l

    What method are you using to send email from your form now? If you are using UTL_SMTP, you can set the MIME_TYPE = 'HTML' as Francois suggests. If you are using an OLE call to Outlook or a email JavaBean? The method you use to send email will dictate how you send Rich Text/HTML email messages.
    Craig...

  • Out put type for simple mail

    Hi Sd Gurus
                 i change the output type  medium from printout to simple-mail. i got a error( Mail partner not found or empty! Obj
    created without partner!). please give the solution.
       Thanks

    Hi Hari,
    Please Check that you assigned any  partner function to the output type.
    and  that e-mail address is maintained for your required  partner.
    Thanks
    Dasaradha

  • Sending mail from forms

    My requirement is to send mail/intimation from forms in case of promotion/appraisal of employee is done.
    Plz tell how to do this.
    Regards,
    Alok

    you can send emails in forms through various techniques. External programs like qmail.exe or something else.
    In the newer databases you have the functionality to send emails in the db.
    Search this forum for utl_smtp. There are many postings with sourcecode

  • Advice on SMTP setup for outgoing mail from internal devices only?

    Hello.
    I'm trying to set up a basic SMTP server using OS X Server (10.5.6) so I can have devices (Server Monitor, my UPS power system alerts, router alerts, etc. — all on the local LAN/same subnet) send out mail when they need to send out alerts. These devices do not have the ability to configure SMTP authentication, so I just need to set up this outgoing SMTP server on one of my Xserves so they have a way of sending said mail.
    Would anyone be willing to provide information on how I'd set this up?
    I thought I had it set up correctly, but whenever I try and send a test email (from my mail.app account), I never receive anything at the intended delivery address (an email address hosted by a 3rd party)?
    Thanks!
    Kristin.

    The default mail server configuration should accept mail from local clients and relay it to the destination domain. The only gotcha would be if the mail server thinks it's authoritative for the domain you're sending to (e.g. you're sending to '[email protected]' and this server thinks it is the mail server for 'yourdomain.com'. There are various ways of overcoming this - the easiest of which is to tell the server it's not authoritative for yourdomain.com.
    The mail logs will give you an indication if that's the problem - it'll either say it delivered the mail locally, or that there was some problem connecting to the remote mail server.
    Either way your ISP can't be blocking outgoing SMTP traffic (well, they could, but it would be pretty stupid of them), but your internal traffic shouldn't be touching your ISP's network anyway, which may indicate a configuration problem.

  • Option for deleting mail from the server?

    hi,
    is there an option in mail that would enable me to delete messages from my server when i delete them from my mail client but keeps the messages i did not delete on my server?
    i know there is an option to delete messages after they've been downloaded, but that's not what i want.
    thanks!
    carys

    Hi,
    I would like for this very thing to happen ...moving mail from my inbox deletes it from the server. However, I've checked that option in the prefs, but it doesn't work.
    I can delete mail [from server] when retrieving it "right away", and I can "remove now", but the "when moved from inbox" options does nothing.
    Any suggestions on how to get this to work?
    PS: I've heard about the cool features of Mail 2.0, but keep in mind that I'm using Panther (w/Mail 1.3.11)
    iBook G4 1.33 w/Mac OS X (10.3.9) w/768 MB    

  • Problem assigning an account for sending mail from external mail app

    Good morning , i have an IPhone 4s 16gb with IOS 7.0.6 and even in setting-mail and calendar i have setup the default account to use for sending mail outside mail app it use ICloud mail account.
    if i select Icloud account and then my gmail account sometimes works but after some days it start again to use the other account...i don't know if it is when i power off the IPhone...if i look into settings-mail and calendar account selected is gmail even the account used is the ICloud.
    i think is a IOS bug.
    please let me know.
    Best regards

    Jun T. wrote:
    But there is a (high) possibility that Gmail's server requires authentication (or certification) to connect to it.
    I wonder if they're simply silently dropping emails in certain cases. I forgot earlier that I have a Gmail account. If I send an email from the command line on my home computer, which is on Comcast, the mail log shows that I successfully connect to Gmail, the message is sent and accepted by Gmail, but the email never arrives in my inbox. I've tried several times with the same result.
    However, emails from a web server from work get through to Gmail without a problem. So I'd bet it's a case of them not delivering mail from Comcast IP addresses.
    For grins, I also tried sending to my Yahoo email account from my home computer and their server at least refuses the connection and I get an error message stating that it's because it's a residential IP address.
    In this case you need an SMTP client (=a software which directly sends the mail to the Gmail server) which supports authentication.
    I think this might also be possible with Postfix by editing the configuration files. I know I had to set up authentication to send emails to my work address directly from my home computers, but I haven't been able to get the same thing to work with Gmail yet. If I get a chance, I'll look into it again later tonight.
    charlie

  • E-mailing from Forms

    Hi,
    I am using the Host command to call a .sql file which spools a .log file. My question is , is there anyway I can e-mail this .log file to a user once its completed.
    We are currently using Lotus Notes Mail server version 5.0.5 for e-mail.
    Any help is appericiated.
    Thanks

    Find out what interfaces does lotus notes expose for automation.
    If you can send an email using lotus notes through a command line you can use forms "host" buil-in.
    If it exposes OLE interfaces you'll be able to use the OLE2 package to do it.
    On metalink.oracle.com you can find notes on how to do this with ms outlook.

Maybe you are looking for

  • Itunes 7.5 painfully slow to open in Vista

    Hey everyone, whenever I plug in my iPod touch or open iTunes the computer hangs for 30secs to 5mins before I am able to go into iTunes and sync my iPod. I have read other places that iTunes is slow for Vista but they were mostly old articles, is ver

  • PPOME custom infotype

    Dear friends, I have added custom OM infotype in PPOME as a new tab page. if i create any organisational unit in ppome, i want to know the immidiate parent organisational unit (ie. Objid of the parent org unit) of this newly created org unit. Also if

  • Save User-Parameter and Roles

    Hello, how can I save userparameters and userroles? We use a CUA. After a client Copy i have to create all parameter and roles for all the users in this client new! How can i solve this problem?

  • Camera not being recognized

    Imovie no longer recognizes my Canon zr950 camera. Is this solvable? How can I get the older version of imovie back?  Im using 10.7.5 and wasn't having a problem untill I upgraded. Thanks

  • Time Machine does not start after external hard drive is connected

    Time Machine does not start after external hard drive is connected