Hi All,

I am using below code to send mail to Lotus Notes.  It works fine except
when I receive a mail message the time stamp is correct. However when
I open the mail message the time stamp in the header is 4 hours off.  It
must have something to do with
 utl_smtp.write_data(connection, header);

Does anyone have any suggestions on what to check?
It is definitely related to Oracle config because if I change below code
from
  header:= 'Date: '||TO_CHAR(SYSDATE,'dd Mon yy hh24:mi:ss')||crlf||    TO
  header:= 'Date: '||TO_CHAR(SYSDATE + 1/6,'dd Mon yy hh24:mi:ss')||crlf||
the time is correct in the mail header.

Thanks
Rick



PROCEDURE mail
  (
  sender      IN VARCHAR2,
  recipient   IN VARCHAR2,
  ccrecipient IN VARCHAR2,
  subject     IN VARCHAR2,
  message     IN VARCHAR2
  ) IS

  crlf VARCHAR2(2):= UTL_TCP.CRLF;
  connection utl_smtp.connection;
  mailhost VARCHAR2(30) := 'my_mailhost';
  header VARCHAR2(1000);
  status VARCHAR2(300);

BEGIN

  --
  -- Start the connection.
  --
  connection := utl_smtp.open_connection(mailhost,25);

  header:= 'Date: '||TO_CHAR(SYSDATE,'dd Mon yy hh24:mi:ss')||crlf||
     'From: '||sender||''||crlf||
  'Subject: '||subject||crlf||
       'To: '||recipient||crlf||
       'CC: '||ccrecipient;

  --
  -- Handshake with the SMTP server
  --
  utl_smtp.helo(connection, mailhost);
  utl_smtp.mail(connection, sender);
  utl_smtp.rcpt(connection, recipient);
  IF TRIM(ccrecipient) IS NOT NULL THEN
  utl_smtp.rcpt(connection, ccrecipient);
END IF;
  utl_smtp.open_data(connection);
  --
  -- Write the header
  --
  utl_smtp.write_data(connection, header);
  --
  -- The crlf is required to distinguish that what comes next is not simply
part of the header..
  --
  utl_smtp.write_data(connection, crlf||crlf ||message);
  utl_smtp.close_data(connection);
  utl_smtp.quit(connection);

 END mail;

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to