?
Solved

about UTL_mail

Posted on 2007-11-26
4
Medium Priority
?
2,756 Views
Last Modified: 2013-12-19
I am trying to develop plsql code to generate automatic email to send as a reminder.I followed the procedure which was stated in the UTL_MAIL in the metalink about the UTL_MAIL.. But iam getting an error message.
I configured the spfile with the servername and port like

alter system set smtp_out_server = 'mail.xxxx.com :25' scope = spfile.

I tried scope=both ; but that dint work so i kept as spfile
and later
create pfile from spfile.


the error is
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object SYS.SEND_EMAIL_TEST102 is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

but the procedure was complied properly and no errors were displayed



@d:\oracle\infra\rdbms\admin\utlmail.sql;
 
@d:\oracle\infra\rdbms\admin\prvtmail.plb;
 
---both were successfully created and i restarted the database before after configuring the spfile 
 
CREATE OR REPLACE PROCEDURE send_email_test102
   BEGIN  
     UTL_MAIL.SEND(sender => 'kxxxx@richards.com', recipients => 'soxxxxn@richards.com', cc => 'sxxxx@richards.com', bcc => 'sxxxx@richards.com', subject => 'Testmail', message => 'Hello');
   EXCEPTION
   WHEN OTHERS THEN
    --  dbms_output.put_line('Fehler');
     raise_application_error(-20001,'The following error has occured: ' || sqlerrm);   
   END;
 
 
exec send_email_test102;
 
here is the pfile
INITinfra.ORA  = pfile
*.aq_tm_processes=1
*.background_dump_dest='D:\Oracle\admin\infra\bdump'
*.compatible='10.1.0.2.0'
*.control_files='D:\Oracle\oradata\infra\CONTROL01.CTL','D:\Oracle\oradata\infra\CONTROL02.CTL','D:\Oracle\oradata\infra\CONTROL03.CTL'
*.core_dump_dest='D:\Oracle\admin\infra\cdump'
*.db_block_size=8192
*.db_cache_size=50331648
*.db_domain='richards.com'
*.db_file_multiblock_read_count=16
*.db_name='infra'
*.db_recovery_file_dest='D:\Oracle\flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP)(PRE=oracle.aurora.server.GiopServer)','(PROTOCOL=TCP)(PRE=oracle.aurora.server.SGiopServer)'
*.java_pool_size=67108864
*.job_queue_processes=5
*.large_pool_size=8388608
*.max_commit_propagation_delay=0
*.open_cursors=300
*.pga_aggregate_target=33554432
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sessions=400
*.shared_pool_size=150994944
*.smtp_out_server='mail.richards.com :25','smtp.richards.com :25','mail.richards.com :','smtp.richards.com :2500'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS'
*.user_dump_dest='D:\Oracle\admin\infra\udump'
 
and also executed utl_smtp just in case
 
@D:\Oracle\infra\rdbms\ADMIN\utlsmtp.sql
 
and everything was in sys as username

Open in new window

0
Comment
Question by:tbksandeep
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 20355791
CREATE OR REPLACE PROCEDURE send_email_test102
   BEGIN  
     UTL_MAIL.SEND(sender => 'kxxxx@richards.com', recipients => 'soxxxxn@richards.com', cc => 'sxxxx@richards.com', bcc => 'sxxxx@richards.com', subject => 'Testmail', message => 'Hello');
   EXCEPTION
   WHEN OTHERS THEN
    --  dbms_output.put_line('Fehler');
     raise_application_error(-20001,'The following error has occured: ' || sqlerrm);  
   END;
/   ---> we should have a / here to first execute this statement which creates the procedure. I am not sure whether you have missed this while pasting your code or your actual code itself does not have this.

Run the above and retry.

Thanks
0
 
LVL 28

Accepted Solution

by:
Naveen Kumar earned 1500 total points
ID: 20355794
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00905: object SYS.SEND_EMAIL_TEST102 is invalid
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

The above means the SYS.SEND_EMAIL_TEST102 is invalid. If you create/compile it properly, then it will be valid and you should be able to execute it without issues.

if you want to check its status,

select owner, object_name, object_type, status
from dba_objects
where object_name ='SEND_EMAIL_TEST102 ';

The status should be valid in the above query output.

Thanks
0
 

Author Closing Comment

by:tbksandeep
ID: 31411132
thanks for the solution which you gave me
0
 

Author Comment

by:tbksandeep
ID: 20358646
nav_kum_v:

thanks for the reply what you posted for checking the status but its not working. so is there someother way to check the status of the procedure

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question