GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 76 of 157    Print  
Hi all I wrote a procedure to send email via plsql procedure, It was compiled sucessfully but not working ....

here is the code (actuly i added the dbms output like step1 ,step 2 to see in which step the control is going on )

create or replace PROCEDURE send_test_message
IS
mailhost VARCHAR2(64) := 'mail.cmcltd.com';
sender VARCHAR2(64) := 'akash.sharma@cmcltd.com';
recipient VARCHAR2(64) := 'lalit.mohan@cmcltd.com';
mail_conn utl_smtp.connection;
BEGIN
dbms_output.put_line('Step:1');
mail_conn := utl_smtp.open_connection(mailhost, 25);
dbms_output.put_line('Step:2');
utl_smtp.helo(mail_conn, mailhost);
dbms_output.put_line('Step:3');
utl_smtp.mail(mail_conn, sender);
dbms_output.put_line('Step:4');
utl_smtp.rcpt(mail_conn, recipient);
dbms_output.put_line('Step:5');
-- If we had the message in a single string, we could collapse
-- open_data(), write_data(), and close_data() into a single call to data().
utl_smtp.open_data(mail_conn);
dbms_output.put_line('Step:6');
utl_smtp.write_data(mail_conn, 'This is a test message.' || chr(13));
dbms_output.put_line('Step:7');
utl_smtp.write_data(mail_conn, 'This is line 2.' || chr(13));
dbms_output.put_line('Step:8');
utl_smtp.close_data(mail_conn);
dbms_output.put_line('Step:9');
dbms_output.put_line('Step:10');
utl_smtp.quit(mail_conn);
dbms_output.put_line('Step:11');
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('not executed i m in exeption ');
END;
/

SQL> exec send_test_message
Step:1
Step:2
Step:3
Step:4
not executed i m in exeption

plz give sum advise what i m doing wrong

thanks

  
Total Answers and Comments: 1 Last Update: May 02, 2007     Asked by: lalit4untl 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 02, 2007 21:07:22   #1  
KiranKW Member Since: May 2007   Contribution: 7    

RE: Hi all I wrote a procedure to send email via plsql...
Hi,

   I dont see any problem with your code ... try to capture the return code for each of the calls ... that will help to identify the exact problem

 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : 1)Using DBMS_JOB package,we can schedule the job.There are number of built-in functions in that package to schedule a job.Ex:DBMS_JOB .SUBMITDBMS_JOB .RUN.2) Using DBMS_SCHEDULERTHIS I SYNTAX FOR CREATING JOBdbms_scheduler.create_job(ob_name             ...
Read Answers (6) | Asked by : kishorebabu

i dont know  
Latest Answer : It's an PL/SQL Package which used to print messages . ...
Read Answers (10) | Asked by : maheshwari

Latest Answer : May be it is better to trace a select statment with on logon trigger.like:CREATE OR REPLACE TRIGGER SYS.ON_LOGON_ALL AFTER LOGON ON DATABASE WHEN (USER = 'MAX') BEGIN EXECUTE IMMEDIATE 'ALTER SESSION SET SQL_TRACE=TRUE'; --EXECUTE IMMEDIATE ...
Read Answers (9) | Asked by : SumanNaidu.S

What is the Scalar Data type in PL/SQL?what is the forward decleration in packages?what is the usage of IN,OUT,INOUT parameters in Procedures or functions?
Read Answers (5) | Asked by : chiranjeevi reddy

Latest Answer : After compiling procedures,functions and triggers(in new versions only),Those will be stored in the form of p-code(after parsing) in SGA(System Global Area).The advantage of p-code is Since it was there in SGA which can be shared by all,Whenever ...
Read Answers (1) | Asked by : richa

Hi,i want to know that,Will the functionality of these two statements:EXEC SQL SET TRANSACTION READ ONLY END-EXECEXEC SQL SET TRANSACTION READ WRITE END-EXECare same as “EXEC SQL SET TRANSACTION REPEATABLE READ END-EXEC”Give me the replacement for the above 2 sql statements.thanks in advance,rashmi
Read Answers (1) | Asked by : rashmi

In PL/SQL I need to get like this scenario. if I am doing manipulation on a table, I need to display a record as Non-Updateable. It need to show a message to the user. How it is possible.Thanks in Advance.
Read Answers (7) | Asked by : murthy

Hi, in Cursors this is the Scenario.if i am manipulating the data of a table which has 10 records,i need to go to the 5th record.how is it possible?What is the Exact usage of Ref Cursor?
Read Answers (1) | Asked by : murthy

Can we call a procedure into another procedure?If yes means how you can pass the perameters for the two procedures?

How do you get the return values in pl/sql when u exec them be sides assigning the values to Bind variables
Read Answers (1) | Asked by : srini


 Sponsored Links

 
Related Articles

Breaking up XML into Relational Data

Breaking up XML into Relational Data While the preceding example shows how to construct an XML representation over relational data the example in this section illustrates how you can shred XML data back into relational data This reverse operation can be useful if your application works with relation
 

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Retrieving XML Data

Retrieving XML DataTo retrieve XML data from an XMLType table you can use a SELECT SQL statement just as you would if you had to query a relational table For example to select the employee with the id set to 100 from the employees XMLType table discussed in the preceding section you might issue the
 

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

ODP.NET - Techniques to Improve Performance while Retrieving Data

ODP NET Techniques to Improve Performance while Retrieving Data Performance tuning is a great subject in Oracle Volumes of books would not be enough to cover every aspect of performance tuning in Oracle However in this section we will only discuss the fundamental performance techniques while working
 

ODP.NET - Working with OracleDataAdapter with OracleCommand

ODP NET Working with OracleDataAdapter together with OracleCommand In the previous examples we worked with OracleDataAdapter by directly specifying SQL statements You can also pass OracleCommand to OracleDataAdapter This is very useful if you deal with stored procedures covered in Chapter 5 or bind
 

ODP.NET - Working with Bind Variables together with OracleParameter

ODP NET Working with Bind Variables together with OracleParameter With the help of OracleParameter you can include bind variables within any SQL statement These bind variables are nothing but run time query parameters The values in the SQL statement are bound at run time when we use bind variables m
 

ODP.NET - Handling Nulls when Working with OracleDataReader

ODP NET Handling Nulls when Working with OracleDataReader When we work with OracleDataReader or for that matter even with data rows in a data table we may come across nulls The following is the efficient way to deal in with such scenarios mosgoogle geshibot language VB NET" create connect
 

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape