-
Oracle mail
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?
Regards,
Anuja K.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|