Sending Attachments using Oracle Alerts
Hi All,
I am working on Oracle Alerts. I have to send an output of the report to the client, is it possible to send using Oracle Alerts.
Thanks in Advance,
Venky.
Hi,
To send attachments using Oracle Alert, you can follow below mentioned steps:
1) While defining Oracle alert Action, Select 'Action Level' as 'Summary'
2) In Action Details, select 'Action Type' as 'Operating System Script'
3) Select 'Text' radio button
4) Write following code : uuencode <Name of the file along with the path> <Name of the attachment in the mail>|mailx -c &cc_mail_id,&to_mail_id -s "<Subject of the Mailer>" &to_mail_id.
5) You can use mail or sendmail command also instead of mailx command.
6) Save Alert details
Thanks and regards,
Indira
Similar Messages
-
Sending Attachments in oracle alerts
Hi All,
I have a requirement where i need to send the output in attachment through mail using Oracle alerts.
Please help.
Thanks in advance,
Gurpreet
Edited by: 880391 on Feb 10, 2012 3:46 AMThe only way you are going to be able to do this is by migrating Alerts to BI Publisher. I've done this recently and I'm starting to document the process here http://oracleapps.smythe.net.au/?q=node/36
-
Sending mails with attachments using oracle 8i
Hi,
Could anybody please send a sample code for sending mails
with attachments using oracle 8i.
Thanks in advanceFor oracle8i there is an example package from OTN:
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
You have to re-write the package a bit to work it with BLOBs instead of RAW attachments, but that should be no problem
Hop this helps,
Michiel -
Sending Attachments using JavaMail
I trying to send attachments using JavaMail API which is loaded into an oracle 8.1.7 database as a stored procedure, the code looks like this:-
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "SendMail" AS
import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class SendMail {
// Sender, Recipient, CCRecipient, and BccRecipient are comma-
// separated lists of addresses;
// Body can span multiple CR/LF-separated lines;
// Attachments is a ///-separated list of file names;
public static int Send(String SMTPServer,
String Sender,
String Recipient,
String CcRecipient,
String BccRecipient,
String Subject,
String Body,
String ErrorMessage[],
String Attachments) {
// Error status;
int ErrorStatus = 0;
// create some properties and get the default Session;
Properties props = System.getProperties();
props.put("mail.smtp.host", SMTPServer);
Session session = Session.getDefaultInstance(props, null);
try {
// create a message;
MimeMessage msg = new MimeMessage(session);
// extracts the senders and adds them to the message;
// Sender is a comma-separated list of e-mail addresses as
// per RFC822;
InternetAddress[] TheAddresses =
InternetAddress.parse(Sender);
msg.addFrom(TheAddresses);
// extract the recipients and assign them to the message;
// Recipient is a comma-separated list of e-mail addresses
// as per RFC822;
InternetAddress[] TheAddresses =
InternetAddress.parse(Recipient);
msg.addRecipients(Message.RecipientType.TO,
TheAddresses);
// extract the Cc-recipients and assign them to the
// message;
// CcRecipient is a comma-separated list of e-mail
// addresses as per RFC822;
if (null != CcRecipient) {
InternetAddress[] TheAddresses =
InternetAddress.parse(CcRecipient);
msg.addRecipients(Message.RecipientType.CC,
TheAddresses);
// extract the Bcc-recipients and assign them to the
// message;
// BccRecipient is a comma-separated list of e-mail
// addresses as per RFC822;
if (null != BccRecipient) {
InternetAddress[] TheAddresses =
InternetAddress.parse(BccRecipient);
msg.addRecipients(Message.RecipientType.BCC,
TheAddresses);
// subject field;
msg.setSubject(Subject);
// create the Multipart to be added the parts to;
Multipart mp = new MimeMultipart();
// create and fill the first message part;
MimeBodyPart mbp = new MimeBodyPart();
mbp.setText(Body);
// attach the part to the multipart;
mp.addBodyPart(mbp);
// attach the files to the message;
if (null != Attachments) {
int StartIndex = 0, PosIndex = 0;
while (-1 != (PosIndex = Attachments.indexOf("///",
StartIndex))) {
// create and fill other message parts;
MimeBodyPart mbp = new MimeBodyPart();
FileDataSource fds =
new FileDataSource(Attachments.substring(StartIndex,
PosIndex));
mbp.setDataHandler(new DataHandler(fds));
mbp.setFileName(fds.getName());
mp.addBodyPart(mbp);
PosIndex += 3;
StartIndex = PosIndex;
// last, or only, attachment file;
if (StartIndex < Attachments.length()) {
MimeBodyPart mbp = new MimeBodyPart();
FileDataSource fds =
new FileDataSource(Attachments.substring(StartIndex));
mbp.setDataHandler(new DataHandler(fds));
mbp.setFileName(fds.getName());
mp.addBodyPart(mbp);
// add the Multipart to the message;
msg.setContent(mp);
// set the Date: header;
msg.setSentDate(new Date());
// send the message;
Transport.send(msg);
} catch (MessagingException MsgException) {
ErrorMessage[0] = MsgException.toString();
Exception TheException = null;
if ((TheException = MsgException.getNextException()) !=
null)
ErrorMessage[0] = ErrorMessage[0] + "\n" +
TheException.toString();
ErrorStatus = 1;
return ErrorStatus;
show errors java source "SendMail"
CREATE OR REPLACE PACKAGE SendMailJPkg AS
-- EOL is used to separate text line in the message body;
EOL CONSTANT STRING(2) := CHR(13) || CHR(10);
TYPE ATTACHMENTS_LIST IS
TABLE OF VARCHAR2(4000);
-- high-level interface with collections;
FUNCTION SendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING DEFAULT '',
BccRecipient IN STRING DEFAULT '',
Subject IN STRING DEFAULT '',
Body IN STRING DEFAULT '',
ErrorMessage OUT STRING,
Attachments IN ATTACHMENTS_LIST DEFAULT NULL)
RETURN NUMBER;
END SendMailJPkg;
show errors
CREATE OR REPLACE PACKAGE BODY SendMailJPkg AS
PROCEDURE ParseAttachment(Attachments IN ATTACHMENTS_LIST,
AttachmentList OUT VARCHAR2) IS
AttachmentSeparator CONSTANT VARCHAR2(12) := '///';
BEGIN
-- boolean short-circuit is used here;
IF Attachments IS NOT NULL AND Attachments.COUNT > 0 THEN
AttachmentList := Attachments(Attachments.FIRST);
-- scan the collection, skip first element since it has been
-- already processed;
-- accommodate for sparse collections;
FOR I IN Attachments.NEXT(Attachments.FIRST) ..
Attachments.LAST LOOP
AttachmentList := AttachmentList || AttachmentSeparator ||
Attachments(I);
END LOOP;
ELSE
AttachmentList := '';
END IF;
END ParseAttachment;
-- forward declaration;
FUNCTION JSendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING,
BccRecipient IN STRING,
Subject IN STRING,
Body IN STRING,
ErrorMessage OUT STRING,
Attachments IN STRING) RETURN NUMBER;
-- high-level interface with collections;
FUNCTION SendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING,
BccRecipient IN STRING,
Subject IN STRING,
Body IN STRING,
ErrorMessage OUT STRING,
Attachments IN ATTACHMENTS_LIST) RETURN NUMBER IS
AttachmentList VARCHAR2(4000) := '';
AttachmentTypeList VARCHAR2(2000) := '';
BEGIN
ParseAttachment(Attachments,
AttachmentList);
RETURN JSendMail(SMTPServerName,
Sender,
Recipient,
CcRecipient,
BccRecipient,
Subject,
Body,
ErrorMessage,
AttachmentList);
END SendMail;
-- JSendMail's body is the java function SendMail.Send();
-- thus, no PL/SQL implementation is needed;
FUNCTION JSendMail(SMTPServerName IN STRING,
Sender IN STRING,
Recipient IN STRING,
CcRecipient IN STRING,
BccRecipient IN STRING,
Subject IN STRING,
Body IN STRING,
ErrorMessage OUT STRING,
Attachments IN STRING) RETURN NUMBER IS
LANGUAGE JAVA
NAME 'SendMail.Send(java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String[],
java.lang.String) return int';
END SendMailJPkg;
show errors
var ErrorMessage VARCHAR2(4000);
var ErrorStatus NUMBER;
-- enable SQL*PLUS output;
SET SERVEROUTPUT ON
-- redirect java output into SQL*PLUS buffer;
exec dbms_java.set_output(5000);
BEGIN
:ErrorStatus := SendMailJPkg.SendMail(
SMTPServerName => 'gmsmtp03.oraclecorp.com',
Sender => '[email protected]',
Recipient => '[email protected]',
CcRecipient => '',
BccRecipient => '',
Subject => 'This is the subject line: Test JavaMail',
Body => 'This is the body: Hello, this is a test' ||
SendMailJPkg.EOL || 'that spans 2 lines',
ErrorMessage => :ErrorMessage,
Attachments => SendMailJPkg.ATTACHMENTS_LIST(
'/tmp/on.lst',
'/tmp/sqlnet.log.Z'
END;
print
If I try and send file as attachments from the tmp directory, then everything works ok, but if I try to send the same file from any other directory, then it doesn't work. Can anyone help? Is there something wrong with the code, I'm not aware of anything that would make it directory specfic. Permissions are the same on /tmp as the new directory /NRS/Data/SystemX which I'm trying to send the file from now.well
if u see the end of ur mail it shows the attachment dir there in which u have specified the address..why don't u do a change there or better have some in parameteres in the procedure for it..that would help in choosing the attachment directory on users wish?
hope i am getting the problem right..if not kindly correct me in understanding the problem.
thanX. -
Can't Send Attachments Using Exchange Account
For some reason I can't send attachments using my Exchange account on my iPhone. Pictures, Word docs, Excel Docs, doesn't matter. They just get stuck in my out box and I get the following message, "Cannot Send Mail - An error occurred while delivering this message." I can receive attachments just fine, but cannot send or forward them. If I use any of the other email accounts on my phone, it works fine. The Exchange account is the only issue. Is this some limitation with Exchange on an iPhone or something? Anyone ever have the same problem as was able to fix it? Thanks!
I've got 38 iPhones deployed running the 3.1.2 OS against an Exchange 2007 server. Several of my users complain about the same issue, and I've seen it myself. I have found a workaround of sorts - I've found that if I've sent a message with an attachment and I get a failure to send, if I manually browse down to the Sent Items folder, that forces a replication of the Sent Items. The next time I do a manual sync, the e-mail with the attachment will go.
I presume this has something to do with Exchange trying to put a copy of the e-mail in to your Sent Items at the same time the iPhone is trying to send the message.
Potentially, this might be solved by turning off the option to always store your sent e-mails in the Sent Items. I have not yet tested that as a workaround as from a corporate standpoint and an ease-of-use standpoint, we want that e-mail in the Sent Items for reference.
If anyone has any success with this fix, please let me know. -
Can we send mails using Oracle
Hi Everybody,
Can we send mails using Oracle (like java mail)?? Can I a write a procedure/stored procedure to send a mail if there is any change in the database tables
nullThere are three Exchange portlets available for use with Portal 3.0.8.9.8 (inbox, calendar, contacts). They will be downloadable from the new Oracle9iAS Portal Partner Catalog which will be up at the end of March. If you wish to use these portlets before then, send me an email request and I will give them to you.
-
How to send attachments using HTTP Binding Adapter?
How to send attachments using HTTP Binding Adapter in Jdeveloper?
Requirement: I need to send attachments to a system which can communicate with the middleware using https only.
Kindly suggest..
Edited by: Richa Juneja on Jan 28, 2013 4:03 AMHi,
Following links may help U
/people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/29/5bd93f130f9215e10000000a155106/frameset.htm
to know the basics about soap adapter u cn check out this link
/people/padmankumar.sahoo/blog/2005/02/15/an-overview-of-soap
to get in detail about the attachments chk out this link
hi i am unable to attach an attachment in File to mail scenario
Regards
Pullarao -
How send attachments to mail using oracle alerts
Hi All,
I am working on Oracle Alerts in oracle applications. how to send attachment to mail.
Thanks in Advance,
Reddy.
Edited by: user9540785 on Mar 22, 2009 4:48 AMAs a workaround, you can kick start a custom workflow in actions rather than sending mail. In that custom workflow you can send attachments as part of the notification to the respective recipients.
Thanks
Nagamohan -
Sending mails based on hierarchy by using Oracle Alerts
Hi All,
From past five days i am facing problem in Oarcle Alerts that my requirement is i need to send mails based on hierarchy people by uisng oracle alert.
In this need to send the mail only the different Hierarchy head person only and i need to do this by using alert only
Can any one please suggest me for this.
Any help is greatly appreciated.
Thanks
AnushkaHi,
i have sql statement Now my problem is how to run 'Sql Statement Script' from Alerts, can you please suggest me on this .I believe this is explained in "Oracle Alert" manual.
Applications Releases 11i and 12
http://www.oracle.com/technology/documentation/applications.html
Thanks,
Hussein -
Send email using Oracle Forms 6i through Outlook Express
I am working on oracle Forms 6i and Oracle 9i (9.2.0.1) database. My requirement is How to trigger email sending single client at a time while using Oracle Forms 6i through Outlook Express?
To do this I have written the following code.
PROCEDURE send_mail IS
OutlookApp OLE2.OBJ_TYPE;
NameSpace OLE2.OBJ_TYPE;
MailItem OLE2.OBJ_TYPE;
OLEPARAM OLE2.LIST_TYPE;
Send OLE2.OBJ_TYPE;
Attachments OLE2.OBJ_TYPE;
Attachment_dummy OLE2.OBJ_TYPE;
var1 varchar2(1000);
Begin
var1 := :mapiole.message;
OutlookApp := OLE2.CREATE_OBJ('Outlook.Application');
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,'MAPI');
NameSpace := OLE2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM) ;
OLE2.DESTROY_ARGLIST(OLEPARAM);
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,0);
MailItem := OLE2.INVOKE_OBJ(OutlookApp,'CreateItem',OLEPARAM);
OLE2.DESTROY_ARGLIST(OLEPARAM);
OLE2.SET_PROPERTY(MailItem,'To',:to);
OLE2.SET_PROPERTY(MailItem,'Subject',:subject);
OLE2.SET_PROPERTY(MailItem,'Body', var1);
--add an attachment
if :mapiole.attach is not null then
Attachments := OLE2.GET_OBJ_PROPERTY(MailItem,'Attachments');
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,:attach);
Attachment_dummy := OLE2.INVOKE_OBJ(Attachments,'add',OLEPARAM);
OLE2.DESTROY_ARGLIST(OLEPARAM);
end if;
Send := OLE2.INVOKE_OBJ(MailItem,'Send');
--destroy objects
OLE2.RELEASE_OBJ(MailItem);
OLE2.RELEASE_OBJ(NameSpace);
OLE2.RELEASE_OBJ(OutlookApp);
END;
Create a block called MAPIOLE with the following canvas layout:
To: ============================
Subject: ============================
Message: ============================
============================
Attachment: ============================ SEND
When I press the SEND button then
Error comes "FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception
ORA-305500
How can I do this?
When I use Microsoft Outlook 2003 It works fine.
Please help me.
Thanks.Error comes "FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception
ORA-305500
hi
plz if there is any attach library recompile it or open the pll and compile it with ctrl+shift+k and ctrl+t.
sarah -
Send email using Oracle Forms 6i through MS Outlook 2003
I am working on oracle Forms 6i and Oracle 9i (9.2.0.1) database. My requirement is How to trigger email sending to clients while using Oracle Forms 6i through Microsoft Outlook 2003?
To do this I have written the following code.
PROCEDURE send_mail IS
OutlookApp OLE2.OBJ_TYPE;
NameSpace OLE2.OBJ_TYPE;
MailItem OLE2.OBJ_TYPE;
OLEPARAM OLE2.LIST_TYPE;
Send OLE2.OBJ_TYPE;
Attachments OLE2.OBJ_TYPE;
Attachment_dummy OLE2.OBJ_TYPE;
var1 varchar2(1000);
Begin
var1 := :mapiole.message;
OutlookApp := OLE2.CREATE_OBJ('Outlook.Application');
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,'MAPI');
NameSpace := OLE2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM) ;
OLE2.DESTROY_ARGLIST(OLEPARAM);
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,0);
MailItem := OLE2.INVOKE_OBJ(OutlookApp,'CreateItem',OLEPARAM);
OLE2.DESTROY_ARGLIST(OLEPARAM);
OLE2.SET_PROPERTY(MailItem,'To',:to);
OLE2.SET_PROPERTY(MailItem,'Subject',:subject);
OLE2.SET_PROPERTY(MailItem,'Body', var1);
--add an attachment
if :mapiole.attach is not null then
Attachments := OLE2.GET_OBJ_PROPERTY(MailItem,'Attachments');
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,:attach);
Attachment_dummy := OLE2.INVOKE_OBJ(Attachments,'add',OLEPARAM);
OLE2.DESTROY_ARGLIST(OLEPARAM);
end if;
Send := OLE2.INVOKE_OBJ(MailItem,'Send');
--destroy objects
OLE2.RELEASE_OBJ(MailItem);
OLE2.RELEASE_OBJ(NameSpace);
OLE2.RELEASE_OBJ(OutlookApp);
END;
Create a block called MAPIOLE with the following canvas layout:
|| To: |============================|
|
| Subject: |============================|
|
| Message: |============================ |
|============================|
| Attachment: |============================| |SEND | |
When I press the SEND button then
Microsoft Office Outlook window open containing the message below.
A program is trying to automatically send e-mail on your behalf.
Do you want to allow this?
If this is unexpected,it may be a virus and you should choose "No".
Yes No Help Button are there.
If choose No then
Error comes "FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception
ORA-305500
else Message send successfully.
I want not to open Outlook Message window and message automatically send to given email id.
How can I do this?
Please help me.
Thanks.Try disable warnings:
Visual Basic 6 (VBA)
OlSecurityManager.ConnectTo OutlookApp
OlSecurityManager.DisableOOMWarnings = True
On Error Goto Finally
'... any action with protected objects ...
Finally:
OlSecurityManager.DisableOOMWarnings = False
If you find correct syntax with OLE2 post your code ;) -
Sending Email by Oracle Alert when no rows returned
Hello All,
I am having one problem.
In the Oracle Alert i wrote one query which is returing 0 rows.
But sometimes it will returns some rows.
And my requirement is that when this query doesn't return any rows , i want to send one email to user that there is no data
and if the data is present then i have to send the data.
But currently there is no data so i made one Oracle Alert and when i am running that Alert then it is showing me a one message and mail doesn't sent
Oracle Alert did not perform the summary action "My Test Alert" because no exceptions were returned for this action set.
Please Suggest
Thanks & RegardsWrite a second alert that fires near about the same time.
select 'send email'
from dual
where 0 = (select count(1) from your_table)
This alert will send a "no rows found" email.
Hope this helps,
Sandeep Gandhi -
Unable to send attachments using Safari.
Safari version is 1.3.1. This is my first post. Have been using Mac's since 1990. Safari gives me an error message each time I try to send attachments , no matter the kind of attachment. Error message is: "Your previous operation was not successful, please try again." When I type the message, follow the attachment instructions and click to send, the message disappears for seconds and then comes back on screen with the error message in red.
This has been going on for months. I am forced to use some other software to send messages with attachments. Any suggestions? I have checked the discussion boards and Apple support, also have reported bug to Apple, no answers.Hi Yang,
I followed your instructions. It made no difference. I emptied my cache. The folder is not locked and I do have 'write' permission.
Now for the embarrasing part of this. I may be blaming the wrong software. I open my computer with Safari, then go to Email and More in Verizon to send messages. Verizon is our DSL provider.
Thanks for your help. I have been reading these discussions for some time and noticed that you frequently respond to questions.
Pat -
Send SMS Using Oracle Database Automatically
Hi ALL:
I want to send SMS from Oracle Database 9i automatically. Which reg. software can I use?Hello,
Here is the Oracle Forms forum.
You would have more chances to get answers by posting in the Database forum ;D
Francois -
How to send attachments using java application and outlook
Hi ,
I created an application in java which is as
on the Conference Tab i can schedule a conference and with the send command on page it map all the scheduled data to outlook(with all conference details) and using outlook send option the mails are send to appropriate user.
but now i want to modify this application such as when i use the send command from my jsp page it should attach the file that is in .vcs or .ics format for auto updation of user calender.
can any one know how to send attachment using java application .Last time I checked, SMS was a service between carriers and doing SMS yourself was really tricky. Some services existed to let you do it but as I recall they wanted non-trivial money.
However, most phone carriers provide an email-to-SMS bridge of some kind.
So the easiest thing is just to send an email.
That's sending from a non-phone to a phone. There's a J2ME library to send/receive SMS from/to a phone.
However, this is from memory, and a little out of date, so I could be entirely wrong. Hope it helps anyway.
Maybe you are looking for
-
Temporary table within a package
I'm not sure this is the best way to achieve it, but I'm trying to use a temporary table within my package, but I failed! In my package, my procedure do receive 5 different phone numbers (vTel1 to vTel5) and I need to order them, using data from a ta
-
Flash Player 16 Installer opens but won't run on 64 bit Wdws 7 and IE 11
I have Flash Player ActiveX Ver. 15.0.0.246 installed on my Dell Inspiron N7010 (Intel Core i3 processor) laptop, running Windows 7 Home Premium 64-bit OS with Service Pack 1, 6 GB of RAM, and using Internet Explorer Ver. 11.0, 32-bit browser. Flash
-
Dear Experts, i am new to XML Form Builders in Portal, so i have started with this document as my first form: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/ee639033-0801-0010-0883-b2c76b18583a?QuickLink=index&overridelayout=true
-
Http server to configure mod plsql for creating DAD required by Workflow
Hi, I have a question. Actually, I am working on Oracle Workflow 2.6.3, which need the Oracle HTTP server to configure the DAD. I have already installed Oracle HTTP server (which called Apache Standalone 10.1.2.0.0) using the Oracle Database10g Compa
-
Can't switch buttons when playing on a dvd player
I searched the discussions and was unable to find an answer to my problem. How do you get the dvd to select different buttons when played on a dvd player? When I play the dvd on a computer the buttons are highlighted when the mouse is placed on them,