| Priya |
Posted: Apr 03, 2008 05:35:23 AM |
Total Post: 19
Joined: Jul, 2007
|
Hi All,
Actually, i need to send a mail with attachment using PL/SQL code.
That attachment file is located in Server directory.
Please let me know how to proceed with UTL_FILE and UTL_SMTP.
Thanks in advance.
Regards,
Priya.V |
|
|
Murtuja |
| Posted: Apr 03, 2008 05:41:25 AM | |
|
Total Post: 857
Joined: Jan, 2006
|
Hi
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
HTH
|
|
|
|
|
Priya |
| Posted: Apr 03, 2008 05:46:44 AM | |
|
Total Post: 19
Joined: Jul, 2007
|
Hi Murtuja,
I tried that code. But when it sends the attachment, it is blank. Please let me know how to set the path for the File in server directory.
Thanks,
Priya.V
|
|
|
|
|
Murtuja |
| Posted: Apr 03, 2008 05:46:56 AM | |
|
Total Post: 857
Joined: Jan, 2006
|
Another method of sending attachments using Java stored procedure
http://asktom.oracle.com/pls/asktom/f?p=100:11:2331967589925392::::P11_QUESTION_ID:255615160805
|
|
|
|
|
Priya |
| Posted: Apr 03, 2008 05:49:08 AM | |
|
Total Post: 19
Joined: Jul, 2007
|
Hi,
I want to send it using PL/SQL Procedure only. Please help.
My requirements are,
The Output of my query should be stored in an Excel file in the server.
That excel file should be sent as an attachement.
Please help.
Regards,
Priya
|
|
|
|
|
Mohammed Taj |
| Posted: Apr 03, 2008 11:54:47 AM | |
|
Total Post: 746
Joined: Jul, 2007
|
Did you try with this
http://www.orafaq.com/wiki/Send_mail_from_PL/SQL
|
|
|
|
|
Mohammed Taj |
| Posted: Apr 03, 2008 11:57:27 AM | |
|
Total Post: 746
Joined: Jul, 2007
|
Check this also
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:503989273966
|
|
|
|
|
narendra |
| Posted: Apr 10, 2008 01:11:40 AM | |
|
Total Post: 1
Joined: Mar, 2008
|
Priya,
i think u r using content encoding as "Content-Transfer-Encoding: 7bit" this will work for text file, while to attach file like excel, doc etc u need to use
1.encoding "Content-Transfer-Encoding: base64"
e.g mesg := mesg || 'Content-Type: ' || filetype ||
'; name="' || file_name || '"' || crlf ||
'Content-Disposition: attachment; filename="' ||
file_name || '"' || crlf ||
'Content-Transfer-Encoding: base64' || crlf || crlf ;
2. open your attachment as bfile and read through dbms_lob
e.g bfile_handle := BFILENAME(directory_name,file_name);
dbms_lob.READ(bfile_handle,read_bytes,pos,Data);
3. write the lob content into message using utl_smtp.write_raw_data
e.g. utl_smtp.write_raw_data(conn,utl_encode.base64_encode(Data));
this work for me. I hope this will work for u too.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |