 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Michael
Joined: 21 Aug 2001 Posts: 8
|
|
attach file |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: attach file |
|
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 |
|
 |
Michael
Joined: 21 Aug 2001 Posts: 8
|
|
Re: attach file |
|
: 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 |
|
 |
Michael
Joined: 21 Aug 2001 Posts: 8
|
|
Re: attach file |
|
: 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 |
|
 |
|
|
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
|
|
|