File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Oracle/OAS and the fly likes Oracle mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Oracle mail" Watch "Oracle mail" New topic
Author

Oracle mail

anuja Edathu
Ranch Hand

Joined: Sep 09, 2005
Posts: 84
Hi,
I am trying to send email from oracle .
Iam using the following procedure for the purpose which i got from one website


CREATE or replace PROCEDURE SENDMAIL (TOO IN VARCHAR2, FROMM IN VARCHAR2,
SUBJECT IN VARCHAR, BODY IN VARCHAR) AS
CONN UTL_SMTP.CONNECTION;

SMTP_HOST VARCHAR2(50) := 'mail.mydomain.com';
PORT VARCHAR2(2) := 25;
MSG_HEADER VARCHAR2(2000) := null;
CR VARCHAR2(2) := chr(10)||chr(13);
MSG_BODY VARCHAR2(4000);
BEGIN
CONN := UTL_SMTP.OPEN_CONNECTION(SMTP_HOST, PORT);
MSG_HEADER := 'Date: ' ||
TO_CHAR(SYSDATE, 'dd-Mon-yy hh24:mi:ss') || CR ||
'Subject: '||SUBJECT|| CR ||
'From: <'||FROMM||'>' || CR ||
'To: '||TOO || CR ||
'' || CR;
MSG_BODY := MSG_HEADER || BODY;
UTL_SMTP.HELO(CONN, SMTP_HOST);
UTL_SMTP.MAIL(CONN, FROMM);
UTL_SMTP.RCPT(CONN, TOO);
UTL_SMTP.DATA(CONN, MSG_BODY);
UTL_SMTP.QUIT(CONN);
end;

This procedure is executed using a pl/sql block. that providing to address from address subject and message body;



But when i receive the mail.
In the actual header part only the date and from address is printed correctly.
Subject is shown as 'no subject'

To: is not even listed in the header.


But since the header is included in the mesage body,it is printed there and that is correct also.

How can i display the subject and to address correctly on the header?


Here is the pl/sql block i used to execute the procedure


BEGIN
SENDMAIL('anuja@mydomaindomain.com',
'anuja@mydomain.com',
'Test Subject',
'Testng mailllll.............................. ');
END;



Can any one help?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Oracle mail
 
Similar Threads
Is it possible to have a store procedre that has PL/SQL code and can call a java obje
Oracle Mail Error
SMTP Authentication in Oracle Mail using utl_smtp package
Is it possible to have a store procedre that has PL/SQL code and can call a java obje
Permission problem calling java from PL/SQL