SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
attach file

 
Reply to topic    SoftTree Technologies Forum Index » DB Audit, DB Mail, DB Tools View previous topic
View next topic
attach file
Author Message
Michael



Joined: 21 Aug 2001
Posts: 8

Post attach file Reply with quote

I am running DBMail on a Windows 2000 server. I have it pointed to an Oracle 8.1.7 instance running on a Linux server. I am able to send email with this configuration, which works very well.
I am having difficulty sending a file attachment. I am trying to send a file on the Linux server. Here is the code. Any ideas on this?

-- The file to send is sqlnet.log
-- The directory is /home/oracle

DECLARE

attach_id INTEGER;

ret_code INTEGER;
BEGIN

attach_id := attach_file (NULL, 1, 'sqlnet.log', '/HOME/ORACLE');

ret_code := send_mail (

'dba@pointcons.com',

'Attach sqlnet.log',

'This message has one attachment',

NULL,

NULL,

NULL,

attach_id

);
END;
/

Thanks for any help,
Michael
.


Fri Aug 24, 2001 9:51 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7838

Post Re: attach file Reply with quote

You cannot specify operation system directory names directly. Instead you must create a DIRECTORY object (see Oracle CREATE DIRECTORY command for creating directory descriptors) and use the name of this object for the last parameter in then attach_file function.

Do not forget to grant appropriate permissions to the new DIRECTORY object.

Good luck!

: I am running DBMail on a Windows 2000 server. I have it pointed to an Oracle
: 8.1.7 instance running on a Linux server. I am able to send email with
: this configuration, which works very well.
: I am having difficulty sending a file attachment. I am trying to send a file
: on the Linux server. Here is the code. Any ideas on this?

: -- The file to send is sqlnet.log
: -- The directory is /home/oracle

: DECLARE

: attach_id INTEGER;

: ret_code INTEGER;
: BEGIN

: attach_id := attach_file (NULL, 1, 'sqlnet.log', '/HOME/ORACLE');

: ret_code := send_mail (

: 'dba@pointcons.com',

: 'Attach sqlnet.log',

: 'This message has one attachment',

: NULL,

: NULL,

: NULL,

: attach_id

: );
: END;
: /

: Thanks for any help,
: Michael
: .

Fri Aug 24, 2001 10:25 am View user's profile Send private message
Michael



Joined: 21 Aug 2001
Posts: 8

Post Re: attach file Reply with quote

: You cannot specify operation system directory names directly. Instead you
: must create a DIRECTORY object (see Oracle CREATE DIRECTORY command for
: creating directory descriptors) and use the name of this object for the
: last parameter in then attach_file function.

: Do not forget to grant appropriate permissions to the new DIRECTORY object.

: Good luck!

Thanks for the prompt help, I really appreciate it. You guys are very helpful. I am getting closer to getting this up and running. This is what I have done:
-- create directory:
CREATE OR REPLACE DIRECTORY log_dir AS '/home/oracle';
-- run procedure:
DECLARE

attach_id INTEGER;

ret_code INTEGER;
BEGIN

attach_id := attach_file (NULL, 1, 'sqlnet.log', 'LOG_DIR');

ret_code := send_mail (

'email@email.com',

'Attach sqlnet.log',

'This message has one attachment',

NULL,

NULL,

NULL,

attach_id

);
END;
/

When running the procedure, it says "PL/SQL procedure successfully completed."
I am still not getting any email sent to my account. Any ideas?
Thanks again,
Michael

Fri Aug 24, 2001 12:02 pm View user's profile Send private message
Michael



Joined: 21 Aug 2001
Posts: 8

Post Re: attach file Reply with quote

: Thanks for the prompt help, I really appreciate it. You guys are very
: helpful. I am getting closer to getting this up and running. This is what
: I have done: -- create directory: CREATE OR REPLACE DIRECTORY log_dir AS
: '/home/oracle';
: -- run procedure: DECLARE

: attach_id INTEGER;

: ret_code INTEGER;
: BEGIN

: attach_id := attach_file (NULL, 1, 'sqlnet.log', 'LOG_DIR');

: ret_code := send_mail (

: 'email@email.com',

: 'Attach sqlnet.log',

: 'This message has one attachment',

: NULL,

: NULL,

: NULL,

: attach_id

: );
: END;
: /

: When running the procedure, it says "PL/SQL procedure successfully
: completed."
: I am still not getting any email sent to my account. Any ideas?
: Thanks again,
: Michael

I have found the problem. Since I am using remote servers for this trial, I am not sitting at the server and looking at the error messages in the DBMail window. I just signed into that server, and have seen the errors on the DBMail system log. The error I was getting was that my email server needed a sender name, it could not be left null. I placed a sender email address into the send_mail procedure and it is working beautifully.
Thanks for your help.
Michael

Fri Aug 24, 2001 12:14 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » DB Audit, DB Mail, DB Tools All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.