Script to send attach file from oracle...
Hi All,
I´m trying to monitoring my tablespaces space usage, using utl_smtp utility, but nothing that I´ve found in web is working. I can send a sample email without attach files, this works well, but when I try to attach a file nothing works. Maybe with a trigger or something I can solve the problem.
Maybe someone of you guys could help me in this task.
Any help would be great!!
Thanks and Regards!
Marcello.
but nothing that I´ve found in web is workingDid you try the sample code from OTN?
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
Similar Messages
-
How to mail pdf file from oracle database 11g
Hi,
Using following code to send pdf file from oracle database.
DECLARE
v_From VARCHAR2(80) := '[email protected]';
v_Recipient VARCHAR2(80) := '[email protected]';
v_Subject VARCHAR2(80) := 'test subject';
v_Mail_Host VARCHAR2(30) := '116.214.31.249';
v_Mail_Conn sys.utl_smtp.Connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
BEGIN
v_Mail_Conn := sys.utl_smtp.Open_Connection(v_Mail_Host, 26);
sys.utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
sys.utl_smtp.Mail(v_Mail_Conn, v_From);
sys.utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
sys.utl_smtp.Data(v_Mail_Conn,
'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
'From: ' || v_From || crlf ||
'Subject: '|| v_Subject || crlf ||
'To: ' || v_Recipient || crlf ||
'MIME-Version: 1.0'|| crlf || -- Use MIME mail standard
'Content-Type: multipart/mixed;'|| crlf ||
' boundary="-----SECBOUND"'|| crlf ||
crlf ||
'-------SECBOUND'|| crlf ||
'Content-Type: text/plain;'|| crlf ||
'Content-Transfer_Encoding: 7bit'|| crlf ||
crlf ||
'some message text'|| crlf || -- Message body
'more message text'|| crlf ||
crlf ||
'-------SECBOUND'|| crlf ||
'Content-Type: file;'|| crlf ||
' name="D:\mail\pdfSample.pdf"'|| crlf ||
'Content-Transfer_Encoding: 8bit'|| crlf ||
'Content-Disposition: attachment;'|| crlf ||
' filename="D:\mail\pdfSample.pdf"'|| crlf ||
crlf ||
'CSV,file,attachement'|| crlf || -- Content of attachment
crlf ||
'-------SECBOUND--' -- End MIME mail
sys.utl_smtp.Quit(v_mail_conn);
EXCEPTION
WHEN sys.utl_smtp.Transient_Error OR sys.utl_smtp.Permanent_Error then
raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
END;
Above code executed successfully and mail is send to recipient but file is corrupted.
I think it doesn't pick file from specified location, attachment name is appearing like this 'D:mailpdfsample.pdf
Oracle Database : 11g R2
O.S : windows 7 Professional
Thanks in Advanceparapr wrote:
sys.utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);The above violates RFC 5321 section 4.1.1.1
'-------SECBOUND'|| crlf ||
'Content-Type: file;'|| crlf ||
' name="D:\mail\pdfSample.pdf"'|| crlf ||
'Content-Transfer_Encoding: 8bit'|| crlf ||
'Content-Disposition: attachment;'|| crlf ||
' filename="D:\mail\pdfSample.pdf"'|| crlf ||Invalid Mime header above. Filename are logical. Not physical. Loose the drive and directory names. The filename is there to name the Mime body's content.
crlf ||
'CSV,file,attachement'|| crlf || -- Content of attachmentHow is the above PDF content? This is a string containing the text CSV,file,attachement. Which means when this is what is saved as a PDF file by the mail reader.
EXCEPTION
WHEN sys.utl_smtp.Transient_Error OR sys.utl_smtp.Permanent_Error then
raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
END;Silly. Why change meaningful exceptions into a generic meaningless exception?? That does not make any sense. -
Send mail witch attach files from forms server 6i
How to attach file from my logical drive , and sending mail via forms web 6i ?
Hi jean,
there is a lot of complication involved with trying to attach files using the java web server, the best thing i have done was i have added a microsoft windows email component on to my form and invoked its methods and properties, for eg. for attaching a file u have something called as microsoft windows common controls which opens the file open dialog box. Remember , trying to build email and messeging kind of applications with oracle tools is a bit complicated as of now because windows 2000 server has additional security features equivalent to standard firewall and the java interface of oracle looks for certifications for each and every cgi request.
Rajendra - [email protected] -
How to create xml file from Oracle and sending the same xml file to an url
How to create xml file from Oracle and sending the same xml file to an url
SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way. -
Sending attachment file through utl_smtp package in oracle 8i
dear friends,
i am facing one problem here. I can send mail
from oracle8i by using utl_smtp or utl_tcp package. but I am not able to send a file
from perticular directory as attachments.
how it will be possible. if any one have idea
about this pl. guide me. it is very urgent.
thanks in advance
sunil kant pandeyCan you provide me a sample code which sends a mail using utl_snmp package ?
thanks in advance,
kalpen.
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by [email protected]:
dear friends,
i am facing one problem here. I can send mail
from oracle8i by using utl_smtp or utl_tcp package. but I am not able to send a file
from perticular directory as attachments.
how it will be possible. if any one have idea
about this pl. guide me. it is very urgent.
thanks in advance
sunil kant pandey<HR></BLOCKQUOTE>
null -
How to send a file from FTP to external server
My requirement is to send a file from FTP to D3(External) server.
Now I am able to store the file in Appln server.
I want to send the file created by the program thru FTP to D3 server.
I know the username,Password,HostID,RFC destination details.
How to send the file from FTP to D3.
If u have any program,Plz send it...
I dont want the function modules name...I want the example code ....
Thanks in advance.Hi Sumi,
You could do it so that you create a .bat or .cmd script to your server which does your ftp transfer.
To do this you must use sm69 to create a external operating system command which you can call from FM SXPG_COMMAND_EXECUTE. To SXPG_COMMAND_EXECUTE you the file you need to transfer as a parameter.
What happens is that your abap program passes the file to windows batch script (.bat .cmd) which will then do the transfer for you.
Here's a sample of ftp-script for windows:
echo open IP_ADDRESS_TO_YOUR_SERVER > c:zftp_transfer.ftp
echo USERNAME>> c:zftp_transfer.ftp
echo PASSWORD>> c:zftp_transfer.ftp
echo put YOUR_FILE>> c:zftp_transfer.ftp
echo quit>> c:zftp_transfer.ftp
ftp -s:c:zftp_transfer.ftp
also take a look here for more details:
http://support.microsoft.com/?kbid=96269
Ok, this might be a bit trivial but if your server is unix/aix etc.. Instead of using batch script you must do a shell script.
Regards,
Ville -
Export an XML file from oracle database
plz help me its urgent requirement....could u pls tell me the step by step procedure for following questions...?how to export a data as an XML file from oracle database? is it possible..?
thanks in advance,
Bala. is it possible?
Edited by: user3523292 on Nov 14, 2008 5:45 AMHere's the quick and dirty method using SQL*Plus...
SQL> select * from emp where deptno = 10;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7839 KING PRESIDENT 17-NOV-81 5000 10
7934 MILLER CLERK 7782 23-JAN-82 1300 10
SQL> set markup html on
SQL> select * from emp where deptno = 10;
<br>
<p>
<table border='1' width='90%' align='center' summary='Script output'>
<tr>
<th scope="col">
EMPNO
</th>
<th scope="col">
ENAME
</th>
<th scope="col">
JOB
</th>
<th scope="col">
MGR
</th>
<th scope="col">
HIREDATE
</th>
<th scope="col">
SAL
</th>
<th scope="col">
COMM
</th>
<th scope="col">
DEPTNO
</th>
</tr>
<tr>
<td align="right">
7782
</td>
<td>
CLARK
</td>
<td>
MANAGER
</td>
<td align="right">
7839
</td>
<td>
09-JUN-81
</td>
<td align="right">
2450
</td>
<td align="right">
</td>
<td align="right">
10
</td>
</tr>
<tr>
<td align="right">
7839
</td>
<td>
KING
</td>
<td>
PRESIDENT
</td>
<td align="right">
</td>
<td>
17-NOV-81
</td>
<td align="right">
5000
</td>
<td align="right">
</td>
<td align="right">
10
</td>
</tr>
<tr>
<td align="right">
7934
</td>
<td>
MILLER
</td>
<td>
CLERK
</td>
<td align="right">
7782
</td>
<td>
23-JAN-82
</td>
<td align="right">
1300
</td>
<td align="right">
</td>
<td align="right">
10
</td>
</tr>
</table>
<p>
SQL>which you can spool to a file. -
How to send JMS message from oracle to weblogic
Hello,
I am facing with a problem of sending jms message from oracle to weblogic. I am using oracle 10g and weblogic server 9.1. Here is the problem. I would like to create a trigger to send JMS message to weblogic server whenever there is an update in oracle database. So I created a java class that will send a jms message to weblogic server. But in that class I use the jndi from weblogic: weblogic.jndi.WLInitialContextFactory
when I use the loadjava utility to load that class into oracle, the status of that class is invalid though this class is working fine in eclipse with the weblogic.jar included. I was thinking because the jndi from weblogic needs the weblogic.jar in order to work, then I loaded that jar file into oracle (it took about 20 minute to load everything) and everything loaded into oracle from that jar file is invalid and missing some reference.
So my question is: how do I send a jms message from oracle to weblogic using a java class with the right jndi?
Any help will be appreciated.
Thanks
TLIt should be quite straightforward to do this. As stated you need weblogic.jar in your classpath, then use 100% standard JMS calls to publish.
Ensure that you set the following properties before getting your initial context:
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://node:7001 (or whatever)
this will ensure that the correct JMS implementation classes are invoked.
You can't easily (without some mucking around) build a test implementation in an AQ environment and then deploy to WebLogic because in AQ you don't tend to use JNDI lookups (unless you've implemented oracle JNDI etc) but rather use non standard factory class to create connections etc. -
How can i attach files in oracle applications
Hi,
How can i attach files in oracle applications ? Is there any thing like open dialogue box?
krishnaHi Naveen,
While I am searching for attaching files to oracle forms in forum, I found you. I have a question; probably you could help me out. I have a custom form which needs to have the facility to open the text files from C drive and load the data into Oracle tables.
The custom form will be attached to Oracle apps responsibility... We are currently using forms6i.
Could you help me out to open a dialog box which provides the users to open the text files from C drive when user clicks on a button
I have attached d2kcomm and d2kwutil to the form. It complies at the form level
but still it is not showing the dialog box.
I would appreciate if you can help me in this regard.
Thanks in Advance
Ravi.
Message was edited by:
ravipampana -
BPM design for trigger based file from Oracle
Hi
We have one requirement as follows:
1. We need to receive trigger file from Oracle.
2. As soon as we recieved trigger file, it needs to activate all other 10 JDBC adapter channels.
3. once reciever all 10 RFC channels completed, it needs to pass that trigger file.
Please suggest design.
Thanks
SivaHi Siva,
1. We need to receive trigger file from Oracle.
define a sender CC (FILE) which polls a directory every N seconds.
The receiver of this message should be your BPM.
2. As soon as we recieved trigger file, it needs to activate all other 10 JDBC adapter channels.
in your BPM, trigger your 10 sender CC (JDBC). See sap help and blog to know how to trigger externally a CC. Easy to do.
3. once reciever all 10 RFC channels completed, it needs to pass that trigger file.
Then always in your BPM, you have to do a correlation on the 10 SQL responses (that's crazy!). Several blogs and threads on this subject.
And after that, in BPM what do you do of these 10 SQL responses (thats' crazy!) ? do you have to merge data ?
Welcome to the birthday of a future monster... for dev and maintenance... Sincerely simplify your flow!
Question: do you really need to have 10 SQL? for your needs, is it not possible to create a stored procedure in database which will do the 10 SQL (with Join tables)... if yes do it, by tis way you will have only one Sender CC (JDBC) to trigger, and no correlation in a BPM. That will greatly simplify your flow.
Regards
Mickael -
Sending .xlsx file from ABAP
Hi Experts,
How can we send .XLSX file from ABAP.
I have done as suggested in note 1459896 but it's not working.
I have added the header table with such value
concatenate '&SO_FILENAME=' lv_filename into lv_text_line.
append lv_text_line to lt_att_head.
passing header table to
lo_document->add_attachment( exporting i_attachment_type = 'XLS'
i_attachment_subject = 'AttachmentFilename'
i_attachment_size = lv_size
i_attachment_header = lt_att_head
i_att_content_hex = binary_content ).
but when I try to open it in SOST it says," file format or extension is not valid " .
Do you think if I send thsi mail to outlook it will work. ?
Thanks
WilliBut SAP note says 1459896 , it can be done
using
filename = 'attachment.xlsx'
concatenate '&SO_FILENAME=' lv_filename into lv_text_line.
append lv_text_line to lt_att_head.
but still not working. -
hi
i need to create an XML with some values file from Oracle Forms 6.0 and then send this XML file To a URL to access the database,which in turn will send me XML file with new values.Can any body help me out as i don't have any ideas
Regards
SunilSunil,
and this must be using a URL and can't be handled by a database stored procedure ?
Anyway, your scenario can be achieved using teh Java Importer in Forms 6i and above. You woudl write a Java program that takes a String and loads it to an URL. It then checks the response URL for its content.
Frank -
Regards sending text sms from oracle forms 10g
Do anybody know about sending the sms from oracle forms.If anybody had means please send me the script......
Welcome to the Oracle Forums. Please take a few minutes to review the following:
<ul>
<li>Before posting on this forum please read
<li>10 Commandments for the OTN Forums Member
<li>Announcement: Forums Etiquette / Reward Points
</ul>
Do anybody know about sending the sms from oracle forms.If anybody had means please send me the script...... This is a commonly asked question. Have you tried searching the forum for possible solutions? Take a look at this search result. I would also recommend you take a look at the Oracle Forms Services 11g web page and scroll down to the Oracle Forms 11g calling a web service link. This is a white paper published by Grant Ronald that specifically describes the process of sending SMS from Oracle Forms.
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Send binary files from SAP System to SAP XI/PI
Dear experts,
in our SAP ERP-System we have a link to JPG files which are stored in an archive. We want to send these files with some other information to our SAP XI and then store them on a file server. Is there a way to send a MIME attachment via RFC? Or is there another way to send binary files from SAP ERP to SAP XI? We want to avoid polling the files on OS level.
Thanks and regards,
DavidMost recommended way is to go for ABAP proxies. They support attachments.
Regards,
Prateek -
How to migrate files from "ORACLE EPM 11" to OBIEE 10g / 11g
Hi
We are moving from ORACLE EPM 11 to OBIEE 10g or 11g .
Can anyone suggest me how to migrate the files from ORACLE EPM11 to OBIEE 10g ?
Regards
Vinod.It would be a good idea to specify the version you are using.
The general plan can be the following:
A. On source db:
1. Generate scripts for the tablespaces where the schema you want to export has segments (again use toad or ther tools)
2.Generate scripts for the schema you want to export (use toad, dbms_metadata or other tools)
3. Generate scripts for system grants, system roles, privileges you have on objects owned by sys, system, quotas on tablespaces
4. If the schema has grants on sys objects that are not part of the default oracle install but were created later and are specific to that particular db (not a good practice, but it can hapen) and your application is dependent on them, generate scripts for them also (I have come across types owned by sys, when migrating an application with Websphere AS)
5. export schema using exp owner=<SCHEMA_NAME>
6. generate scripts for public synonyms and grants to public on object schema
B. On target db.
1. create tablespaces with generated scripts from A.1.
2. create schema with generated scripts from A.2.
3. grant all privileges from A.3.
4. if non default objects on sys needed, create them with scripts from A.4., grant privileges on these objects
5. imp with option fromuser=<SCHEMA_NAME> touser=<SCHEMA_NAME>
6. create public synonyms, grants from A.6.
7. check jobs - if you import with sys or system user, jobs will be imported under this users; drop jobs nad recreate jobs under your schema
I hope I haven't forget anything and this helps...
Ioan
Edited by: ioan on 6.10.2008 13:00
Maybe you are looking for
-
Networking a Mac Pro to a PB G4
Hi everyone, I recently bought a Mac Pro as an upgrade to my PowerBook G4. I still like to keep the PB around for when I'm on the road. Originally, I had the two networked with a firewire 800 cable so I could pass files to and from, and everything wo
-
Hi All, We have a scenario using AS2 adapter which was working fine. Now the AS2 Certificate has expired and our partner has given us the new certificate and asked us to upload it. I have changed the Certificate name in all Sender and Receiver agreem
-
I have a single BATCH file and I want to write program to run in vie Java. Anybody can help me?
-
Portal application sync using Portal APIs
Hi All, I am trying automate the EBCC sync process using Portal APIs. I think it's very common since it avoids the manual sync process & helpful in creating batch process using Ant. Is anybody did this before??, please let me know if you have any sug
-
I want to edit PNG file. But i can't it. Please tell me.
public void Database() try InputStream inputstream1 = getClass().getResourceAsStream(name1); InputStream inputstream2 = getClass().getResourceAsStream(name2); int ch; int index = 0; int