Oracle ODI 10g- Package-Internet-Send Email Functionality
Hi ,
I have created a scenario for the package and successfully executed it the ODI 10g developer.
Here, I have need a clarification if,
1) We can trigger out an email with the exception occured in between the execution of the scenario.
2) Upon successful completion of the scenerio, can we send an email with email body as "total number of count of rows Inserted/Updated/Deleted".
3) What are the extra features available wrt the above two points.
Please let me know if any one has any updates on the points mentioned.
Regards,
Kamalesh.
864083 wrote:
Hi ,
I have created a scenario for the package and successfully executed it the ODI 10g developer.
Here, I have need a clarification if,
1) We can trigger out an email with the exception occured in between the execution of the scenario.Yes you can ... for this put an email activity after the senario with KO . and use getPrevStepLog() Method to get the exception .
2) Upon successful completion of the scenerio, can we send an email with email body as "total number of count of rows Inserted/Updated/Deleted".same as no 1. use getPrevStepLog() Method to get the execution result .
3) What are the extra features available wrt the above two points.
Please let me know if any one has any updates on the points mentioned.http://gerardnico.com/doc/odi/webhelp/en/ref_api/getprevsteplog.htm
Regards,
Kamalesh.
Similar Messages
-
Is there a way to disable 'Save as' and 'Send Email' function in Acrobat XI?
Hi,
Is there a way to disable 'Save as' and 'Send Email' function in Acrobat XI?
Thnx in advance.I would hope there would be no way to disable Save AS that would reduce the applicationss capability. What are you trying to prevent happening?
-
APEX SEND EMAIL FUNCTION NOT SENDING EMAIL
Hi All,
For some reason that I can't figure out is not send any email... Could yo please help me to find it?
DECLARE
CreationDate date;
ClosureDate date;
IncidentsQty NUMBER;
Tool varchar(100);
BEGIN
SELECT COUNT(STUCK_RELATED_TO_PROBLEM) into IncidentsQty
FROM INCIDENTS
WHERE STUCK_RELATED_TO_PROBLEM = :P57_INCIDENT_ID;
SELECT IDATE INTO CreationDate
FROM PROBLEMS
WHERE ID = :P57_INCIDENT_ID;
SELECT CDATE INTO ClosureDate
FROM PROBLEMS
WHERE ID = :P57_INCIDENT_ID;
SELECT TOOL INTO Tool
FROM PROBLEMS
WHERE ID = :P57_INCIDENT_ID;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
APEX_MAIL.send(
p_to => '[email protected]',
p_from => :app_user,
p_body => 'SERVICE DESK NOTIFICATIONS: NEW UPDATE HAS BEEN REPORTED INTO AN PROBLEM',
p_body_html => '<p>The details of the problem closed are the following: <br>
<p>Creation date: ' || CreationDate || ' <br>
Closure date: '|| ClosureDate ||'<br>
Incidents Qty: '|| IncidentsQty ||'<br>
Observations: '|| :P57_IUPDATE ||'</p><br>
p_SUBJ => 'The problem for the tool ' || TOOL || ' (ID# '|| :P57_INCIDENT_ID ||') has been closed.',
p_cc => '',
p_bcc => NULL ,
p_replyto => NULL
END;Hello Bernardo,
>
For some reason that I can't figure out is not send any email... Could yo please help me to find it?
>
Please do provide necessary information so the picture about your problem is clear for the forum members.
The blog post by one of the eminent person working with Oracle Technologies @Tom Kyte might help:
http://tkyte.blogspot.in/2005/06/how-to-ask-questions.html
Now coming to your posted procedure snippet:
APEX_MAIL.send (
p_to => '[email protected]',
p_from => :app_user,
p_body => 'SERVICE DESK NOTIFICATIONS: NEW UPDATE HAS BEEN REPORTED INTO AN PROBLEM',
p_body_html => '<p>The details of the problem closed are the following: <br>
<p>Creation date: ' || CreationDate || ' <br>
Closure date: '|| ClosureDate ||'<br>
Incidents Qty: '|| IncidentsQty ||'<br>
Observations: '|| :P57_IUPDATE ||'</p><br>',
p_SUBJ => 'The problem for the tool ' || TOOL || ' (ID# '|| :P57_INCIDENT_ID ||') has been closed.',
p_cc => '',
p_bcc => NULL ,
p_replyto => NULL
);As you have not given APEX Version information I will go with APEX Version Application Express 4.2.0.00.27.
I would recommend you to go through the documentation of [url http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_mail.htm#CIHDIEJI]APEX_MAIL to help you debug the problem.
This is what i want you to check with your email configuration:
<ul>
<li>Have you configured the email settings on the Instance Settings page.
Refer: http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35129/adm_mg_service_set.htm#BEJBCEEH</li>
<li>Have you checked the configuration works fine? You can use the examples given in the documentation of APEX_MAIL.SEND Procedure.
Refer: http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_mail.htm#CHDDAAJE
Note: User SQL Commands from your APEX Workspace for this purpose.
Also after sending email check for the error in APEX_MAIL_QUEUE or APEX_MAIL_LOG using query:
-- Check whether the mail has been queued
SELECT *
FROM APEX_MAIL_QUEUE;
-- Push the mail for delivery
BEGIN
APEX_MAIL.PUSH_QUEUE;
END;
-- Check whether the mail has been delivered without any error
-- check for MAIL_SEND_ERROR column
SELECT *
FROM APEX_MAIL_LOG;</li>
<li>Are you using Oracle Database Release 11.1 or higher version ? If yes then you have to configure network services to enable the host to send email. Refer: http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/sec_admin_ssl.htm#HTMDB12006</li>
<li>Are you invoking the APEX_MAIL procedures through a database package? If yes then you have to set the SECURITY_GROUP_ID.
Refer the starting of APEX_MAIL documentation.
Use the following code before invoking APEX_MAIL procedures:
p_app_id should be the Application Number of your APEX application.
for c1 in (
select workspace_id
from apex_applications
where application_id = p_app_id )
loop
apex_util.set_security_group_id(p_security_group_id =>
c1.workspace_id);
end loop;</li>
</ul>
This is what i find doubting about the code snippet:
<ul>
<li>Is APP_USER passing valid email ID?</li>
<li>Note the usage of utl_tcp.crlf in the APEX_MAIL.SEND procedure examples in the documentation.</li>
<li>Why have you passed empty string to the parameter p_cc ? Note that empty string is not equal to NULL.</li>
<li>Instead of passing data directly to the parameters you can use variables, assign data to variables and pass variables instead.</li>
</ul>
In order to get accurate/appropriate response you should include at least following information with your question:
<ul>
<li>Full APEX version</li>
<li>Full Database version</li>
<li>APEX Web server architecture (EPG, OHS or APEX listener)</li>
<li>Browser(s) and version(s) used</li>
<li>Operating system with version, architecture(32/64)</li>
</ul>
The above information will help the forum members to ascertain the problem context and post most relevant response.
Please read the [url https://wikis.oracle.com/display/Forums/Forums+FAQ]FAQ and [url https://forums.oracle.com/forums/ann.jspa?annID=1324]forum instructions for more information on using OTN forums effectively.
Please perform a [url https://forums.oracle.com/forums/search!default.jspa]forum search before posting a question as this will help reduce duplicate threads.
Please mark the reply as helpful or correct as this will help other members on the forum with similar question.
Hope it helps!
Regards,
Kiran -
Problem with Adobe Send Email functionality
I have come across an issue in Adobe Reader 9 where if a PDF doucment loads with an IE frame, and you click the 'Send Email' button, the subject line is blank.
Example URL: http://sc.openoffice.org/excelfileformat.pdf
On clicking the Send Email button -> Send Copy
Does anyone know a workaround to get the subject line populated?
In addition, with previous versions of Abode (6,7,8) the subject line defaults to the name of the PDF instead of the PDF title? Is there a way of changing this?
Any help would be most appreciated.I'm sorry to hear that you're having a problem with sending your files through Adobe Send. Can you provide more details?
What type of file are you sending?
When you download the file yourself, is it blank?
Are all recipients having the same problem?
Do the recipients get a Preview of the file?
Are they seeing the blank document as a Preview as well as after downloading?
Would it be possible for you to send the file to me through Adobe Send? I will provide you with my email address in a Private Message. -
Adding the send email function on a form.
Hey,
This has been bugging me lately. I have tried lots of methods
to try and get this form to send to a specified email, yet I cannot
get my head around it. I tried integrating PHP, it worked...to some
extent. Problem was that the application was not defined as a form
and the email sent was all screwed up ( no titles and shizzles ).
Also, I had to add validators to the form, so I had to start from
scratch again.
Here is the current form code.
<?xml version="1.0" encoding="utf-8"?>
<!-- validators\FullApp.mxml -->
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.ValidationResultEvent;
private var vResult:ValidationResultEvent;
private function validateAndSubmit():void {
vResult = fNameV.validate();
if (vResult.type==ValidationResultEvent.INVALID)
return;
vResult = lNameV.validate();
if (vResult.type==ValidationResultEvent.INVALID)
return;
]]>
</mx:Script>
<mx:Model id="formInfo">
<formData>
<name>
<firstName>{fNameInput.text}</firstName>
<lastName>{lNameInput.text}</lastName>
</name>
<phoneNum>{phoneInput.text}</phoneNum>
<email>{emailInput.text</email>
</formData>
</mx:Model>
<mx:StringValidator id="fNameV"
required="true"
source="{fNameInput}"
property="text"/>
<mx:StringValidator id="lNameV"
required="true"
source="{lNameInput}"
property="text"/>
<mx:PhoneNumberValidator id="pnV"
source="{phoneInput}"
property="text"/>
<mx:EmailValidator id="emV"
source="{emailInput}"
property="text"/>
<mx:Form x="271" y="25">
<mx:FormItem label="First name">
<mx:TextInput id="fNameInput"/>
</mx:FormItem>
<mx:FormItem label="Last name">
<mx:TextInput id="lNameInput"/>
</mx:FormItem>
<mx:FormItem label="Phone">
<mx:TextInput id="phoneInput"/>
</mx:FormItem>
<mx:FormItem label="Email">
<mx:TextInput id="emailInput"/>
</mx:FormItem>
</mx:Form>
<mx:Button label="Submit"
click="validateAndSubmit();" x="373" y="195"/>
</mx:Application>
I know I have to add some sort of HTTPService and then
connect it to a PHP form sender. But how? I have searched high and
low and have yet to find a solid answer with some good code that
will work with most forms.
Thanks a lot.
Kindest regards,
DavidHave you checked out the RIA Codes tutorial at http://www.riacodes.com/flex/create-an-email-form-in-flex-with-php/? They show how to do this, I'm pretty sure.
-
How to Run Oracle DeveloperSuite 10g on Internet Explorer 8 in Win XP SP2
I am using windows XP SP2
I am using Developer Suite 10g
I can run form in Internet Explore 6 but I can't run it in IE8 or in Mozilla Firefox 3.6
How can i run form in IE8 or MF3.6.
I need your help.
Thanks
ZicoAnd this has what to do with installation/upgrade/environment/migration of WebLogic Server?
-
Function that would send email with body of select output
Hello support,
I want to create a function which would send an email of such type
BEGIN
flows_030100.wwv_flow_mail.send(
p_subj => 'test'
,p_body => I WANT A SELECT OUTPUT HERE :)))
,p_from => 'sender@mail'
,p_to => 'recepient@mail'
flows_030100.wwv_flow_mail.push_queue_background();
END;
I need a select output to be a body of an email.
Thank you in advance.Hi,
In our WMS system we use the demo_mail package to send emails when we get system errors, you can write content to the body within a cursor or for i in (select ....) loop
conn utl_smtp.connection;
begin
conn := demo_mail.begin_mail(
sender => 'Helpdesk <[email protected]>',
recipients => V_Recipients,
subject => 'A WMS error has occurred!',
mime_type => demo_mail.MULTIPART_MIME_TYPE);
demo_mail.write_text(
conn => conn,
message => 'A system error has occurred at ' || I_Origin || ' while being operated by user ' || I_Username);
utl_smtp.write_data(conn, utl_tcp.CRLF);
utl_smtp.write_data(conn, utl_tcp.CRLF);
demo_mail.write_text(
conn => conn,
message => 'The error details are: ' || I_Notes);
for i in (SELECT STATEMENT HERE..) loop
demo_mail.write_text(
conn => conn,
message => i.field_name;
utl_smtp.write_data(conn, utl_tcp.CRLF);
end loop;
utl_smtp.write_data(conn, utl_tcp.CRLF);
demo_mail.write_text(
conn => conn,
message => V_Insert_Error);
demo_mail.end_mail( conn => conn );Hope this helps.
Graham. -
SAP BPC MS - Send email through the implementation of a package
Hi everyone!!!
I want to know if there is a way to create a package to send emails.
I need to put a step in a custom menu that sends an email to notify users.
I thought to do this via package execution. Maybe there is another way.
I count on your help.
Thanks!I am not aware of any way to use Data Manager packages to send email, unless the email content and execution happens in SQL. A SQL Mail command is something that could possibly be stored in a DM package, but that SQL feature is being phased out by Microsoft. Another potential option is to build a mail macro into the Excel workbooks. But there is no programmatic way in BPC to send mail like this as far as I know.
Brian -
How to send Email with attachments
Hi im Trying to send a file as attachment using EMail Activity operator.
Can we do it using Email activity? If yes, then how can we do it? If no, then please tell me about any other method using which i can send a email with attachments.
Regards
VibhutiBetter late than never, a comprehensive demo on the topic:
REM
REM maildemo.sql - A PL/SQL package to demonstrate how to use the UTL_SMTP
REM package to send emails in ASCII and non-ASCII character sets, emails
REM with text or binary attachments.
REM
REM Note: this package relies on the UTL_ENCODE PL/SQL package in Oracle 9i.
CREATE OR REPLACE PACKAGE demo_mail IS
----------------------- Customizable Section -----------------------
-- Customize the SMTP host, port and your domain name below.
smtp_host VARCHAR2(256) := 'smtp-server.some-company.com';
smtp_port PLS_INTEGER := 25;
smtp_domain VARCHAR2(256) := 'some-company.com';
-- Customize the signature that will appear in the email's MIME header.
-- Useful for versioning.
MAILER_ID CONSTANT VARCHAR2(256) := 'Mailer by Oracle UTL_SMTP';
--------------------- End Customizable Section ---------------------
-- A unique string that demarcates boundaries of parts in a multi-part email
-- The string should not appear inside the body of any part of the email.
-- Customize this if needed or generate this randomly dynamically.
BOUNDARY CONSTANT VARCHAR2(256) := '-----7D81B75CCC90D2974F7A1CBD';
FIRST_BOUNDARY CONSTANT VARCHAR2(256) := '--' || BOUNDARY || utl_tcp.CRLF;
LAST_BOUNDARY CONSTANT VARCHAR2(256) := '--' || BOUNDARY || '--' ||
utl_tcp.CRLF;
-- A MIME type that denotes multi-part email (MIME) messages.
MULTIPART_MIME_TYPE CONSTANT VARCHAR2(256) := 'multipart/mixed; boundary="'||
BOUNDARY || '"';
MAX_BASE64_LINE_WIDTH CONSTANT PLS_INTEGER := 76 / 4 * 3;
-- A simple email API for sending email in plain text in a single call.
-- The format of an email address is one of these:
-- someone@some-domain
-- "Someone at some domain" <someone@some-domain>
-- Someone at some domain <someone@some-domain>
-- The recipients is a list of email addresses separated by
-- either a "," or a ";"
PROCEDURE mail(sender IN VARCHAR2,
recipients IN VARCHAR2,
subject IN VARCHAR2,
message IN VARCHAR2);
-- Extended email API to send email in HTML or plain text with no size limit.
-- First, begin the email by begin_mail(). Then, call write_text() repeatedly
-- to send email in ASCII piece-by-piece. Or, call write_mb_text() to send
-- email in non-ASCII or multi-byte character set. End the email with
-- end_mail().
FUNCTION begin_mail(sender IN VARCHAR2,
recipients IN VARCHAR2,
subject IN VARCHAR2,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
priority IN PLS_INTEGER DEFAULT NULL)
RETURN utl_smtp.connection;
-- Write email body in ASCII
PROCEDURE write_text(conn IN OUT NOCOPY utl_smtp.connection,
message IN VARCHAR2);
-- Write email body in non-ASCII (including multi-byte). The email body
-- will be sent in the database character set.
PROCEDURE write_mb_text(conn IN OUT NOCOPY utl_smtp.connection,
message IN VARCHAR2);
-- Write email body in binary
PROCEDURE write_raw(conn IN OUT NOCOPY utl_smtp.connection,
message IN RAW);
-- 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);
-- Send a binary attachment. The attachment will be encoded in Base-64
-- encoding format.
PROCEDURE attach_base64(conn IN OUT NOCOPY utl_smtp.connection,
data IN RAW,
mime_type IN VARCHAR2 DEFAULT 'application/octet',
inline IN BOOLEAN DEFAULT TRUE,
filename IN VARCHAR2 DEFAULT NULL,
last IN BOOLEAN DEFAULT FALSE);
-- Send an attachment with no size limit. First, begin the attachment
-- with begin_attachment(). Then, call write_text repeatedly to send
-- the attachment piece-by-piece. If the attachment is text-based but
-- in non-ASCII or multi-byte character set, use write_mb_text() instead.
-- To send binary attachment, the binary content should first be
-- encoded in Base-64 encoding format using the demo package for 8i,
-- or the native one in 9i. End the attachment with end_attachment.
PROCEDURE begin_attachment(conn IN OUT NOCOPY utl_smtp.connection,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
inline IN BOOLEAN DEFAULT TRUE,
filename IN VARCHAR2 DEFAULT NULL,
transfer_enc IN VARCHAR2 DEFAULT NULL);
-- End the attachment.
PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
last IN BOOLEAN DEFAULT FALSE);
-- End the email.
PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection);
-- Extended email API to send multiple emails in a session for better
-- performance. First, begin an email session with begin_session.
-- Then, begin each email with a session by calling begin_mail_in_session
-- instead of begin_mail. End the email with end_mail_in_session instead
-- of end_mail. End the email session by end_session.
FUNCTION begin_session RETURN utl_smtp.connection;
-- Begin an email in a session.
PROCEDURE begin_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection,
sender IN VARCHAR2,
recipients IN VARCHAR2,
subject IN VARCHAR2,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
priority IN PLS_INTEGER DEFAULT NULL);
-- End an email in a session.
PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection);
-- End an email session.
PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection);
END;
CREATE OR REPLACE PACKAGE BODY demo_mail IS
-- Return the next email address in the list of email addresses, separated
-- by either a "," or a ";". The format of mailbox may be in one of these:
-- someone@some-domain
-- "Someone at some domain" <someone@some-domain>
-- Someone at some domain <someone@some-domain>
FUNCTION get_address(addr_list IN OUT VARCHAR2) RETURN VARCHAR2 IS
addr VARCHAR2(256);
i pls_integer;
FUNCTION lookup_unquoted_char(str IN VARCHAR2,
chrs IN VARCHAR2) RETURN pls_integer AS
c VARCHAR2(5);
i pls_integer;
len pls_integer;
inside_quote BOOLEAN;
BEGIN
inside_quote := false;
i := 1;
len := length(str);
WHILE (i <= len) LOOP
c := substr(str, i, 1);
IF (inside_quote) THEN
IF (c = '"') THEN
inside_quote := false;
ELSIF (c = '\') THEN
i := i + 1; -- Skip the quote character
END IF;
GOTO next_char;
END IF;
IF (c = '"') THEN
inside_quote := true;
GOTO next_char;
END IF;
IF (instr(chrs, c) >= 1) THEN
RETURN i;
END IF;
<<next_char>>
i := i + 1;
END LOOP;
RETURN 0;
END;
BEGIN
addr_list := ltrim(addr_list);
i := lookup_unquoted_char(addr_list, ',;');
IF (i >= 1) THEN
addr := substr(addr_list, 1, i - 1);
addr_list := substr(addr_list, i + 1);
ELSE
addr := addr_list;
addr_list := '';
END IF;
i := lookup_unquoted_char(addr, '<');
IF (i >= 1) THEN
addr := substr(addr, i + 1);
i := instr(addr, '>');
IF (i >= 1) THEN
addr := substr(addr, 1, i - 1);
END IF;
END IF;
RETURN addr;
END;
-- Write a MIME header
PROCEDURE write_mime_header(conn IN OUT NOCOPY utl_smtp.connection,
name IN VARCHAR2,
value IN VARCHAR2) IS
BEGIN
utl_smtp.write_data(conn, name || ': ' || value || utl_tcp.CRLF);
END;
-- Mark a message-part boundary. Set <last> to TRUE for the last boundary.
PROCEDURE write_boundary(conn IN OUT NOCOPY utl_smtp.connection,
last IN BOOLEAN DEFAULT FALSE) AS
BEGIN
IF (last) THEN
utl_smtp.write_data(conn, LAST_BOUNDARY);
ELSE
utl_smtp.write_data(conn, FIRST_BOUNDARY);
END IF;
END;
PROCEDURE mail(sender IN VARCHAR2,
recipients IN VARCHAR2,
subject IN VARCHAR2,
message IN VARCHAR2) IS
conn utl_smtp.connection;
BEGIN
conn := begin_mail(sender, recipients, subject);
write_text(conn, message);
end_mail(conn);
END;
FUNCTION begin_mail(sender IN VARCHAR2,
recipients IN VARCHAR2,
subject IN VARCHAR2,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
priority IN PLS_INTEGER DEFAULT NULL)
RETURN utl_smtp.connection IS
conn utl_smtp.connection;
BEGIN
conn := begin_session;
begin_mail_in_session(conn, sender, recipients, subject, mime_type,
priority);
RETURN conn;
END;
PROCEDURE write_text(conn IN OUT NOCOPY utl_smtp.connection,
message IN VARCHAR2) IS
BEGIN
utl_smtp.write_data(conn, message);
END;
PROCEDURE write_mb_text(conn IN OUT NOCOPY utl_smtp.connection,
message IN VARCHAR2) IS
BEGIN
utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(message));
END;
PROCEDURE write_raw(conn IN OUT NOCOPY utl_smtp.connection,
message IN RAW) IS
BEGIN
utl_smtp.write_raw_data(conn, message);
END;
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) IS
BEGIN
begin_attachment(conn, mime_type, inline, filename);
write_text(conn, data);
end_attachment(conn, last);
END;
PROCEDURE attach_base64(conn IN OUT NOCOPY utl_smtp.connection,
data IN RAW,
mime_type IN VARCHAR2 DEFAULT 'application/octet',
inline IN BOOLEAN DEFAULT TRUE,
filename IN VARCHAR2 DEFAULT NULL,
last IN BOOLEAN DEFAULT FALSE) IS
i PLS_INTEGER;
len PLS_INTEGER;
BEGIN
begin_attachment(conn, mime_type, inline, filename, 'base64');
-- Split the Base64-encoded attachment into multiple lines
i := 1;
len := utl_raw.length(data);
WHILE (i < len) LOOP
IF (i + MAX_BASE64_LINE_WIDTH < len) THEN
utl_smtp.write_raw_data(conn,
utl_encode.base64_encode(utl_raw.substr(data, i,
MAX_BASE64_LINE_WIDTH)));
ELSE
utl_smtp.write_raw_data(conn,
utl_encode.base64_encode(utl_raw.substr(data, i)));
END IF;
utl_smtp.write_data(conn, utl_tcp.CRLF);
i := i + MAX_BASE64_LINE_WIDTH;
END LOOP;
end_attachment(conn, last);
END;
PROCEDURE begin_attachment(conn IN OUT NOCOPY utl_smtp.connection,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
inline IN BOOLEAN DEFAULT TRUE,
filename IN VARCHAR2 DEFAULT NULL,
transfer_enc IN VARCHAR2 DEFAULT NULL) IS
BEGIN
write_boundary(conn);
write_mime_header(conn, 'Content-Type', mime_type);
IF (filename IS NOT NULL) THEN
IF (inline) THEN
write_mime_header(conn, 'Content-Disposition',
'inline; filename="'||filename||'"');
ELSE
write_mime_header(conn, 'Content-Disposition',
'attachment; filename="'||filename||'"');
END IF;
END IF;
IF (transfer_enc IS NOT NULL) THEN
write_mime_header(conn, 'Content-Transfer-Encoding', transfer_enc);
END IF;
utl_smtp.write_data(conn, utl_tcp.CRLF);
END;
PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
last IN BOOLEAN DEFAULT FALSE) IS
BEGIN
utl_smtp.write_data(conn, utl_tcp.CRLF);
IF (last) THEN
write_boundary(conn, last);
END IF;
END;
PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection) IS
BEGIN
end_mail_in_session(conn);
end_session(conn);
END;
FUNCTION begin_session RETURN utl_smtp.connection IS
conn utl_smtp.connection;
BEGIN
-- open SMTP connection
conn := utl_smtp.open_connection(smtp_host, smtp_port);
utl_smtp.helo(conn, smtp_domain);
RETURN conn;
END;
PROCEDURE begin_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection,
sender IN VARCHAR2,
recipients IN VARCHAR2,
subject IN VARCHAR2,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
priority IN PLS_INTEGER DEFAULT NULL) IS
my_recipients VARCHAR2(32767) := recipients;
my_sender VARCHAR2(32767) := sender;
BEGIN
-- Specify sender's address (our server allows bogus address
-- as long as it is a full email address ([email protected]).
utl_smtp.mail(conn, get_address(my_sender));
-- Specify recipient(s) of the email.
WHILE (my_recipients IS NOT NULL) LOOP
utl_smtp.rcpt(conn, get_address(my_recipients));
END LOOP;
-- Start body of email
utl_smtp.open_data(conn);
-- Set "From" MIME header
write_mime_header(conn, 'From', sender);
-- Set "To" MIME header
write_mime_header(conn, 'To', recipients);
-- Set "Subject" MIME header
write_mime_header(conn, 'Subject', subject);
-- Set "Content-Type" MIME header
write_mime_header(conn, 'Content-Type', mime_type);
-- Set "X-Mailer" MIME header
write_mime_header(conn, 'X-Mailer', MAILER_ID);
-- Set priority:
-- High Normal Low
-- 1 2 3 4 5
IF (priority IS NOT NULL) THEN
write_mime_header(conn, 'X-Priority', priority);
END IF;
-- Send an empty line to denotes end of MIME headers and
-- beginning of message body.
utl_smtp.write_data(conn, utl_tcp.CRLF);
IF (mime_type LIKE 'multipart/mixed%') THEN
write_text(conn, 'This is a multi-part message in MIME format.' ||
utl_tcp.crlf);
END IF;
END;
PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection) IS
BEGIN
utl_smtp.close_data(conn);
END;
PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection) IS
BEGIN
utl_smtp.quit(conn);
END;
END;
/ -
I have an html page that was designed for our previous portal. Now that we have migrated to EP 7.0 we need to alter the script. The page uses javascript to send the email based on the email URL of the previous portal.
http://server/portal/pls/portal/myportal.prc_send_email
I was hoping I could just modify this statement to point to EP http://send-email functionality but was wondering if EP 7.0 has a similar ability?
If so could someone point me in the right direction for knowing what to change the statement to.
If not could someone point me in the right direction for creating a jsp page that would send the email?Thanks Again for your help.
I have gotten the data to pass from the form to the bean and then into the email class. It works fine up until the Email is actually supposed to send and then I get this error:
Caused by: java.lang.NoClassDefFoundError: javax.mail.Address
package com.email;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import com.bean.emailBean;
public class Email
public boolean sendEmail(emailBean bEmail) throws Exception
//Set Fields for Email based on the Email Bean
String sFromEmail = bEmail.getFromEmail();
String sToEmail = bEmail.getToEmail();
String sSubject = bEmail.getSubject();
String sContent = bEmail.getContent();
String sHost = "hub.mymail.com";
Properties props = new Properties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.host", sHost);
Session session = Session.getDefaultInstance(props, null);
session.setDebug(false);
//Create new mime message object
Message msg = new MimeMessage(session);
try
msg.setFrom(new InternetAddress(sFromEmail));
msg.setRecipient(Message.RecipientType.TO,(new InternetAddress(sToEmail)));
msg.setSubject(sSubject);
msg.setContent(sContent, "text/plain");
Transport.send(msg);
return true;
catch(Exception e)
return false;
I have included the mail.jar file as a UsedDC in the project - so it compiles fine and I cannot figure out why it cannot see the classes associated to the file. Any suggestions as to what might be going wrong here? Perhaps I am missing a reference for Portal.xml? (although the sample JSP Email Part 2 doesn't include anything I don't have so I doubt that it is but...) -
Send Email Hangs - UTL_SMTP
Hi All,
I am tryin to write a package to send email notifications, when i try to execute this package it just hangs and never sends any email. Any taughts why this is happening.
create or replace package body
pm.email_pkg
is
-- Email Package
mv_r varchar2(2) := utl_tcp.crlf;
procedure send_mail
sender in varchar2,
recipient in varchar2,
subject in varchar2 default null,
message in varchar2
is
mailhost varchar2(30) := util_pkg.f_sysinfo('SMTP');
smtpport number := util_pkg.f_sysinfo('SMTP_PORT');
mail_conn utl_smtp.connection;
begin
mail_conn := utl_smtp.open_connection(mailhost, smtpport);
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, sender);
utl_smtp.rcpt(mail_conn, recipient);
--utl_smtp.data ( mail_conn, 'Subject : '|| subject || mv_r || mv_r || message );
utl_smtp.open_data(mail_conn) ;
utl_smtp.write_data(mail_conn, 'Subject : '|| subject || mv_r || mv_r || message );
utl_smtp.close_data(mail_conn);
utl_smtp.quit(mail_conn);
exception
when others then
-- handle the error
null;
end send_mail;
procedure taskemail
is
cursor c_tasks is
select t.name, t.techuser, t.projectid, p.name pname, t.assigndate, t.descr
from tasks t, projects p
where t.projectid = p.projectid
and trunc(t.created) = trunc(sysdate);
cursor c_notify (pv_user varchar2) is
select id
from notifications
where owner = pv_user
and notid = util_pkg.f_sysinfo('TASK_NOTIFY');
mv_sender varchar2(64) := util_pkg.f_sysinfo('SENDER_EMAIL');
mv_recipient varchar2(64);
mv_subject varchar2(100) ;
mv_message varchar2(4000);
begin
for i in c_tasks
loop
select email
into mv_recipient
from user_info
where user_name = i.techuser;
if mv_recipient is not null then
mv_subject := 'Assigned to:' || i.name;
mv_message := 'You have been Assign the following Task' || mv_r;
mv_message := mv_message || mv_r;
mv_message := mv_message || 'Task: ' || i.name || mv_r;
mv_message := mv_message || 'Project ' || i.pname || mv_r;
mv_message := mv_message || mv_r;
mv_message := mv_message || 'Description:' || mv_r ;
mv_message := mv_message || i.descr;
for j in c_notify(i.techuser)
loop
email_pkg.send_mail(mv_sender, mv_recipient, mv_subject, mv_message);
end loop;
end if;
end loop;
end taskemail;
procedure email_notifications
is
begin
email_pkg.taskemail;
end;
end email_pkg;
show errorsSQL> begin
2 email_pkg.email_notifications;
3 end;
4 /
begin
ERROR at line 1:
ORA-29531: no method get_crlf in class oracle/plsql/net/TCPConnection
ORA-06512: at "SYS.UTL_TCP", line 559
ORA-06512: at "SYS.UTL_TCP", line 552
ORA-06512: at "PM.EMAIL_PKG", line 7
ORA-06512: at line 2 -
Sending email with report as attachment
Dear folks,
I'm using [this |http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html] package to send emails through database, and it works.
My question is: how to attach report to email which is sent by this package?
Any help on this would be highly appreciated.
Regards,
AdnanadnanBIH wrote:
Dear folks,
I'm using [this |http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html] package to send emails through database, and it works.
My question is: how to attach report to email which is sent by this package?
Any help on this would be highly appreciated.
Regards,
AdnanDear Adnan. I've written a blog post on this subject. You can view it from the following link:
http://kamranagayev.wordpress.com/2009/02/23/using-oracle-utl_file-utl_smtp-packages-and-linux-shell-scripting-and-cron-utility-together-2/ -
SharePoint Foundation 2013 Workflow Doesn't Send Email
We are trying to create a workflow that will send an email if a field in a new item in a list contains a certain value.
Example: A user adds a new item to a particular list. The workflow is supposed to send an email if the Number field = 3 in that item.
We can add the item, but the workflow doesn't appear to send the email.
The workflow looks like this:
Step 1: If Current Item:Number equals 3
Email John Doe
then Stop the workflow
Any ideas would be appreciated. Thanks.Try adding Current Item:Number to log history and check the values are matching properly.
Validate the data types like both are number field to get your condition through. else add an intermediate variable to help this.
Check the send email functionality with out any conditions to validate your smtp configured properly at server.
Hope this helps.
Bistesh -
Proper syntax for email function including a repeat region
Hey Guys, a fellow ADDT developer and myself ran into a odd challenge recently and was wondering if someone knew a shorter answer.
LET ME BE CLEAR..I’m not looking for a suggestion, we have resolved the problem..we ARE LOOKING FOR PROPER or shortest FORMAT.
(we used a submit redirect to a php page that used the “Send Page Section” and then redirected back..the email looks great)
This may be a mood point since ADDT is going away but, until then, we feel this will be an useful post because quite often you may have multiple products to email from your SQL statement.
With that said. We used the send email function on submit.
1. Our email content was a HTML content file. Since it was not a php file our repeat region obviously did not work.
2. We substituted the HTML file for PHP (just for giggles)..no joy
3. We tried regular content as a string..no joy
We know how to get single rows with the {table.column} format…but we need to list all undetermined number of products/rows.
So how would the string or function re-write look if you needed a repeat region.
EX:
emailContent (“ this” . ‘does’. “work”); regular string
emailContent (“ this” . $var . “work”); regular string
emailContent (“ this” . do{ $row; } while( xxx = xxx) . “work”); DOES NOT WORK
emailContent (“ this” . while( xxx = xxx) { $row; } . “work”); DOES NOT WORK
I assume the conflict is you can’t have a function like DO or While in the string….but I also can’t use a php include file.
There must be a shorter, cleaner syntax that won’t require an advanced set of arrays or for each???
so how would a nice clean example of repeat region results inside email content, or include file for email contnent, look?
ThanksDavid, in theory I agree with you, but to a large degree I am completely changing the logic of my human interface. My existing code pre-processes the raw data and saves the results to disk for any future usage.
It can then rapidly rebuild all pages for the entire Intranet site when your personal view of the data is changed.
After the full creation of all pages, the fixed pages can be viewed using your browser.
When you want to change your view, you run the code which completely rebuilds every Intranet page.
My new software will approach the data differently. My raw data will be stored with no pre-processing. The pre-processing will occur as the user changes dates and the pages will be built individually on demand, one at a time.
The second phase of my Windows Form app will be to create pop-up windows that allow the users to modify the definitions for their custom views of the market.
When a view is changed, the software will be able to pre-process, as needed, the current date’s data and rebuild the current page with any new changes.
I intend to create a Refresh.cpp file. The various segments of the Form’s code will set variable such as date change, view changed, watch list changed, etc. and then call Refresh().
The refresh code will then be able to do the minimum recalculation necessary to rebuild the proper HTML stream.
This is another reason to break up the code into various cpp segments such as: LoadRawData, RecalculateViews, BuildPage, etc.
PS: David, I tried to send you a personal e-mail using your home page link.
Hope that was OK and not against forum rules! -
Send email when a value in the table reached a certain number
Hello,
I have a value in a table that when this value is equal or greater than a certain value, I want to send an email to alert. How do I accomplish this? Do I create a trigger? Do I write an o/s korn script and schedule to run continuosly and check for the value to send an email? Thanks.Hi, i think that the best form is create a trigger on the table, when insert o update the data send the email when the value accomplish the condition.
Look the next code, it is a package that send emails,
CREATE OR REPLACE
PACKAGE oracle_administrator.dbms_mail_server
IS
P_SERVERNAME VARCHAR(50);
P_RCPT VARCHAR(50);
P_FROM VARCHAR(50);
P_TO VARCHAR(50);
P_SUBJECT VARCHAR(50);
P_BODY CLOB;
P_MAIL UTL_SMTP.CONNECTION;
PROCEDURE INIT_SERVER;
PROCEDURE SEND_EMAIL;
PROCEDURE WRITE_DATA(PARAM_DATA IN CLOB);
END;
CREATE OR REPLACE
PACKAGE BODY oracle_administrator.dbms_mail_server
IS
PROCEDURE SEND_EMAIL
AS
BEGIN
UTL_SMTP.CLOSE_DATA(P_MAIL);
UTL_SMTP.QUIT(P_MAIL);
END;
PROCEDURE INIT_SERVER
AS
BEGIN
P_MAIL :=UTL_SMTP.OPEN_CONNECTION(P_SERVERNAME);
UTL_SMTP.HELO(P_MAIL,'hostname');
UTL_SMTP.MAIL(P_MAIL,'dbaoracle');
UTL_SMTP.RCPT(P_MAIL,P_RCPT);
UTL_SMTP.OPEN_DATA(P_MAIL);
UTL_SMTP.WRITE_DATA(P_MAIL,
'FROM: ' ||P_FROM || UTL_TCP.CRLF||
'TO: ' || P_TO || UTL_TCP.CRLF ||
'SUBJECT: ' ||P_SUBJECT || UTL_TCP.CRLF ||
'MIME-VERSION: 1.0' ||CHR(13)|| CHR(10)||'CONTENT-TYPE: TEXT/HTML' || CHR(13)||CHR(10));
END;
PROCEDURE WRITE_DATA(PARAM_DATA IN CLOB)
AS
BEGIN
UTL_SMTP.WRITE_DATA(P_MAIL,PARAM_DATA);
END;
END;
Luck
Have a goof day.
Regards
Maybe you are looking for
-
and need the new iTunes 11.1 to be able to use my iPhone on iTunes but I need the new mac software update OXS 10.6.8, but my mac doesn't need or have an update what should I do! I'm upset :'(
-
Messaging Server cannot send email to gmail but can send email to yahoo
I'm using Messaging server 7.0. My company's domain is {color:#ff0000}*sun-vietnam.com*{color} and the email server name is {color:#ff0000}*mail.sun-vietnam.com*{color}, this name is {color:#ff0000}*registered and resolved*{color} correctly in the DN
-
hi, My P7N2 Diamond won't boot. when i first tested it at my friend's house, the problem already occurred. but i was not sure if it was complete bricked because the processor we used was listed supported only under the new bios. so i brought it home
-
After upgrade to 2.6.28, vmware workstation does not start
After upgrading to the 2.6.28 kernel, vmware does not start. It complains with: Could not open /dev/vmmon: No such file or directory. Please make sure that the kernel module `vmmon' is loaded. I have found that I can run the following command to load
-
Cannot connect to database after installing 10g
Hello friends at www.oracle.com , after installing Oracle 10g, I am trying to use programs like SQL*Plus or Forms Builder. However, these programs are asking me for the host string, and: - I cannot simply ignore this question, because I cannot connec