Home » SQL & PL/SQL » SQL & PL/SQL » how to attach a file?
how to attach a file? [message #426381] Thu, 15 October 2009 03:28 Go to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Hi,
A file already created under a directory on server. How to attach that file in E-mail using (utlsmtp) plsql.(the coding i got from Oracle site)

I dont know how to make the pointer to locate that file lying under server.

Please Guide me

kanish
Re: how to attach a file? [message #426383 is a reply to message #426381] Thu, 15 October 2009 03:38 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Which code from the oracle site are you using?

Personally, I'd use UTL_MAIL for this.
Re: how to attach a file? [message #426394 is a reply to message #426381] Thu, 15 October 2009 04:33 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

The following link (My database version is Oracle 9i)

http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/maildemo_sql.txt

kanish
Re: how to attach a file? [message #426402 is a reply to message #426394] Thu, 15 October 2009 04:59 Go to previous messageGo to next message
Michel Cadot
Messages: 63801
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Is this not the following?
  -- APIs to send email with attachments. Attachments are sent by sending
  -- emails in "multipart/mixed" MIME format. Specify that MIME format when
  -- beginning an email with begin_mail().
  
  -- Send a single text attachment.
  PROCEDURE attach_text(conn         IN OUT NOCOPY utl_smtp.connection,
			data         IN VARCHAR2,
			mime_type    IN VARCHAR2 DEFAULT 'text/plain',
			inline       IN BOOLEAN  DEFAULT TRUE,
			filename     IN VARCHAR2 DEFAULT NULL,
		        last         IN BOOLEAN  DEFAULT FALSE);

Regards
Michel
Re: how to attach a file? [message #426408 is a reply to message #426381] Thu, 15 October 2009 05:29 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Yes that i know michel. But how locate the file using pl sql coding. like

should i want give with path? or etc.

kanish
Re: how to attach a file? [message #426412 is a reply to message #426408] Thu, 15 October 2009 05:38 Go to previous messageGo to next message
Michel Cadot
Messages: 63801
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What happened when you tried?

Regards
Michel
Re: how to attach a file? [message #426413 is a reply to message #426408] Thu, 15 October 2009 05:38 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
???

Yes - you need to provide a filename, including path, that locates the file on the server.
Re: how to attach a file? [message #426423 is a reply to message #426381] Thu, 15 October 2009 06:29 Go to previous message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Thanks i will try and back with solution.


kanish
Previous Topic: Connect_by error
Next Topic: error while running sql query
Goto Forum:
  


Current Time: Sat Sep 24 19:45:32 CDT 2016

Total time taken to generate the page: 0.10873 seconds